本文整理汇总了PHP中BaseAction::_initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseAction::_initialize方法的具体用法?PHP BaseAction::_initialize怎么用?PHP BaseAction::_initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseAction
的用法示例。
在下文中一共展示了BaseAction::_initialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initialize
public function _initialize()
{
parent::_initialize();
// 查找当前token店铺所属的帐号->所在的小区->的小区号->的第一个公众帐号的token
$community_token = null;
if (!empty($_GET['token'])) {
//查找当前token所属的帐号
$wxuser = M('Wxuser')->where(array('token' => $_GET['token']))->find();
if (!empty($wxuser)) {
//查找所属帐号
$user = M('Users')->where(array('id' => $wxuser['uid']))->find();
if (!empty($user)) {
// 查看用户所属小区的小区帐号
$user['community_id'];
$xq_user = M('Users')->where(array('community_id' => $user['community_id'], 'account_type' => 1))->find();
if (!empty($xq_user)) {
//查找该用户的所有公众号,并把第一个公众号作为小区公众号
$xq_wxusers = M('Wxuser')->where(array('uid' => $xq_user['id']))->select();
if (!empty($xq_wxusers)) {
$community_token = $xq_wxusers[0]['token'];
}
}
}
}
}
//读取公司信息
$company = M('Company')->where(array('token' => $_GET['token']))->find();
$this->assign('company', $company);
$homeInfo = M('Home')->where(array('token' => $_GET['token']))->find();
$this->assign('homeInfo', $homeInfo);
$this->assign('community_token', $community_token);
}
示例2: _initialize
protected function _initialize()
{
$sql = 'SHOW COLUMNS FROM `' . C('DB_PREFIX') . 'user`';
$COLUMNS = M()->query($sql);
foreach ($COLUMNS as $vo) {
$COLUMNS_array[] = $vo['Field'];
}
if (!in_array('is_admin', $COLUMNS_array)) {
$sql = 'ALTER TABLE `' . C('DB_PREFIX') . 'user` ADD `is_admin` INT NOT NULL DEFAULT \'0\'';
M()->query($sql);
}
if (!isset($_SESSION['username'])) {
$this->error('非法操作', U('System/Admin/index'));
}
parent::_initialize();
C('NOT_AUTH_ACTION', '');
C('NOT_AUTH_MODULE', 'Admin');
if (C('USER_AUTH_ON') && !in_array(MODULE_NAME, explode(',', C('NOT_AUTH_MODULE')))) {
if (!RBAC::AccessDecision()) {
if (!$_SESSION[C('USER_AUTH_KEY')]) {
redirect(PHP_FILE . C('USER_AUTH_GATEWAY'));
}
if (C('RBAC_ERROR_PAGE')) {
redirect(C('RBAC_ERROR_PAGE'));
} else {
if (C('GUEST_AUTH_ON')) {
$this->assign('jumpUrl', PHP_FILE . C('USER_AUTH_GATEWAY'));
}
$this->error(L('_VALID_ACCESS_'));
}
}
}
$this->show_menu();
}
示例3: _initialize
public function _initialize()
{
parent::_initialize();
$this->where = array('token' => $this->token);
$this->modules = array('Home' => '首页', 'Classify' => '网站分类', 'Group' => '团购', 'Meal' => '订餐', 'Lottery' => '大转盘', 'Guajiang' => '刮刮卡', 'Coupon' => '优惠券', 'Card' => '会员卡', 'GoldenEgg' => '砸金蛋', 'LuckyFruit' => '水果机', 'Article' => '文章', 'Weidian' => '微店');
$this->arr = array('game', 'Red_packet');
}
示例4: _initialize
protected function _initialize()
{
// dump(session('username'));die;
// 统一使用member前缀,防止与原系统的混淆
if (!isset($_SESSION['member_uid'])) {
// echo $_SESSION['username'];die;
$this->error('非法操作', U('PayMembers/Member/login'));
}
parent::_initialize();
// if (C('USER_AUTH_ON') && !in_array(MODULE_NAME, explode(',', C('NOT_AUTH_MODULE')))) {
// if (!RBAC::AccessDecision()) {
// //检查认证识别号
// if (!$_SESSION[C('USER_AUTH_KEY')]) {
// //跳转到认证网关
// redirect(PHP_FILE . C('USER_AUTH_GATEWAY'));
// }
// // 没有权限 抛出错误
// if (C('RBAC_ERROR_PAGE')) {
// // 定义权限错误页面
// redirect(C('RBAC_ERROR_PAGE'));
// } else {
// if (C('GUEST_AUTH_ON')) {
// $this->assign('jumpUrl', PHP_FILE . C('USER_AUTH_GATEWAY'));
// }
// // 提示错误信息
// $this->error(L('_VALID_ACCESS_'));
// }
// }
// }
// $this->show_menu();
}
示例5: _initialize
public function _initialize()
{
parent::_initialize();
$this->member = D('Member');
$this->assign('current', 'member');
$this->setTitle("成员 - " . $this->groupinfo['name']);
}
示例6: _initialize
protected function _initialize(){
if(!isset($_SESSION['username'])){$this->error('非法操作',U('System/Adminsaivi/index'));}
parent::_initialize();
if (C('USER_AUTH_ON') && !in_array(MODULE_NAME, explode(',', C('NOT_AUTH_MODULE')))) {
if (!RBAC::AccessDecision()) {
//检查认证识别号
if (!$_SESSION [C('USER_AUTH_KEY')]) {
//跳转到认证网关
redirect(PHP_FILE . C('USER_AUTH_GATEWAY'));
}
// 没有权限 抛出错误
if (C('RBAC_ERROR_PAGE')) {
// 定义权限错误页面
redirect(C('RBAC_ERROR_PAGE'));
} else {
if (C('GUEST_AUTH_ON')) {
$this->assign('jumpUrl', PHP_FILE . C('USER_AUTH_GATEWAY'));
}
// 提示错误信息
$this->error(L('_VALID_ACCESS_'));
}
}
}
$this->show_menu();
}
示例7: _initialize
public function _initialize()
{
parent::_initialize();
$this->assign('token', $this->token);
$this->wxuser_db = M('Merchant_info');
$this->member_card_set_db = M('Member_card_set');
$thisWxUser = $this->wxuser_db->where(array('token' => $this->token))->find();
$thisUser = $this->merchant_session;
$can_cr_num = $thisWxUser['allcardnum'] - $cardTotal;
if (0 < $can_cr_num) {
$data['cardisok'] = 1;
} else {
$data['cardisok'] = 0;
}
$id = intval($_GET['id']);
if ($id) {
$this->thisCard = $this->member_card_set_db->where(array('id' => $id))->find();
if ($this->thisCard && $this->thisCard['token'] != $this->token) {
$this->error('非法操作');
}
$this->assign('thisCard', $this->thisCard);
}
$type = $this->_get('type', 'intval');
$this->assign('type', $type ? $type : 1);
}
示例8: _initialize
protected function _initialize()
{
parent::_initialize();
$userinfo = M('User_group')->where(array('id' => session('gid')))->find();
$users = M('Users')->where(array('id' => $_SESSION['uid']))->find();
$this->assign('thisUser', $users);
//dump($users);
$this->assign('viptime', $users['viptime']);
if (session('uid')) {
if ($users['viptime'] < time()) {
/*
session(null);
session_destroy();
unset($_SESSION);
*/
$_SESSION['gid'] = 1;
$_SESSION['gname'] = "vip0";
//$users['viptime'] = strtotime("+1 month");
//$this->success('您的帐号已经到期,请充值后再使用');
}
}
$wecha = M('Wxuser')->field('wxname,wxid,headerpic,weixin')->where(array('token' => session('token'), 'uid' => session('uid')))->find();
$this->assign('wecha', $wecha);
$this->assign('token', session('token'));
$this->assign('userinfo', $userinfo);
if (session('uid') == false) {
$this->redirect('Home/Index/login');
}
}
示例9: _initialize
public function _initialize()
{
parent::_initialize();
if (empty($this->config['is_open_oauth']) && empty($this->merchant_session['is_open_oauth'])) {
$this->error('你没有这个使用权限', U('Index/index'));
}
}
示例10: header
function _initialize()
{
parent::_initialize();
if (!$this->_userid) {
header("Location: " . U('User/Login/index'));
exit;
}
$this->dao = M('User');
$this->assign('bcid', 0);
$user = $this->dao->find($this->_userid);
if (empty($user["wxpas"])) {
$himt = "<script type=\"text/javascript\">\$(document).ready(function(){alert(\"你还没绑定微信请扫描二维码绑定!\");});</script>";
$this->assign("himt", $himt);
}
$user["username"] = $user["realname"] != "" ? $user["realname"] . "[" . $user["username"] . "]" : $user["username"];
//////////////获得绑定二维码
import("@.ORG.Weixin");
$wechatObj = new Wechat();
$user["ticket"] = $wechatObj->ewm($user["id"], 0);
//////////////获得绑定二维码
$this->user = $user;
$this->assign('vo', $user);
unset($_POST['status']);
unset($_POST['groupid']);
unset($_POST['amount']);
unset($_POST['point']);
$_GET = get_safe_replace($_GET);
$order["count"] = M("order")->where(array('status' => 0, 'userid' => $this->_userid))->count();
$order["all"] = M("order")->where(array('userid' => $this->_userid))->count();
$order["ok"] = M("order")->where(array('status' => 1, 'userid' => $this->_userid))->count();
$this->assign('order', $order);
$this->assign('actionname', ACTION_NAME);
}
示例11: _initialize
protected function _initialize()
{
$sql = "SHOW COLUMNS FROM `" . C("DB_PREFIX") . "user`";
$COLUMNS = M()->query($sql);
foreach ($COLUMNS as $vo) {
$COLUMNS_array[] = $vo["Field"];
}
if (!in_array("is_admin", $COLUMNS_array)) {
$sql = "ALTER TABLE `" . C("DB_PREFIX") . "user` ADD `is_admin` INT NOT NULL DEFAULT '0'";
M()->query($sql);
}
if (!isset($_SESSION["username"])) {
$this->error("非法操作", U("System/Admin/index"));
}
parent::_initialize();
C("NOT_AUTH_ACTION", "");
C("NOT_AUTH_MODULE", "Admin");
if (C("USER_AUTH_ON") && !in_array(MODULE_NAME, explode(",", C("NOT_AUTH_MODULE")))) {
if (!RBAC::AccessDecision()) {
if (!$_SESSION[C("USER_AUTH_KEY")]) {
redirect(PHP_FILE . C("USER_AUTH_GATEWAY"));
}
if (C("RBAC_ERROR_PAGE")) {
redirect(C("RBAC_ERROR_PAGE"));
} else {
if (C("GUEST_AUTH_ON")) {
$this->assign("jumpUrl", PHP_FILE . C("USER_AUTH_GATEWAY"));
}
$this->error(L("_VALID_ACCESS_"));
}
}
}
$this->show_menu();
}
示例12: D
function _initialize()
{
parent::_initialize();
$dao = D('User');
$user = $dao->find($this->mid);
$this->assign('user', $user);
}
示例13: __construct
public function __construct()
{
parent::_initialize();
if ($_GET['wid']) {
$database_userinfo = D('Userinfo');
$condition_userinfo['id'] = $_GET['wid'];
$now_user_info = $database_userinfo->field('`wecha_id`,`token`')->where($condition_userinfo)->find();
$this->wecha_id = $now_user_info['wecha_id'];
$this->token = $now_user_info['token'];
}
else {
$this->wecha_id = $this->_get('wecha_id');
$this->token = $this->_get('token');
}
if (empty($_GET['platform'])) {
$payConfig = M('Alipay_config')->where(array('token' => $this->token))->find();
$payConfigInfo = unserialize($payConfig['info']);
$this->payConfig = $payConfigInfo['allinpay'];
}
else {
$payConfigInfo['merchantId'] = C('platform_allinpay_merchantId');
$payConfigInfo['merchantKey'] = C('platform_allinpay_merchantKey');
$this->payConfig = $payConfigInfo;
}
}
示例14: M
function _initialize()
{
parent::_initialize();
$this->dao = M('User');
$this->assign('bcid', 0);
$_POST = get_safe_replace($_POST);
}
示例15: _initialize
public function _initialize()
{
parent::_initialize();
$info = M('function_master')->where(array('class' => 1))->order('orderno asc')->select();
$info = $this->convertLinks($info);
//加外链等信息
}