當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BaseAction::_initialize方法代碼示例

本文整理匯總了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);
 }
開發者ID:fengsmith1988,項目名稱:weixin-1,代碼行數:32,代碼來源:XiaoquAction.class.php

示例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();
 }
開發者ID:hehekeke,項目名稱:pigcms,代碼行數:34,代碼來源:BackAction.class.php

示例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');
 }
開發者ID:belerweb,項目名稱:pigcms,代碼行數:7,代碼來源:LinkAction.class.php

示例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();
 }
開發者ID:noikiy,項目名稱:vsuninpay,代碼行數:31,代碼來源:Back2Action.class.php

示例5: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $this->member = D('Member');
     $this->assign('current', 'member');
     $this->setTitle("成員 - " . $this->groupinfo['name']);
 }
開發者ID:yang7hua,項目名稱:hunshe,代碼行數:7,代碼來源:MemberAction.class.php

示例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();
	}
開發者ID:royalwang,項目名稱:saivi,代碼行數:25,代碼來源:BackAction.class.php

示例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);
 }
開發者ID:belerweb,項目名稱:pigcms,代碼行數:25,代碼來源:CardAction.class.php

示例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');
     }
 }
開發者ID:yakrsa,項目名稱:football,代碼行數:29,代碼來源:UserAction.class.php

示例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'));
     }
 }
開發者ID:belerweb,項目名稱:pigcms,代碼行數:7,代碼來源:WeixinAction.class.php

示例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);
 }
開發者ID:anywn3773,項目名稱:gzsrex,代碼行數:33,代碼來源:IndexAction.class.php

示例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();
 }
開發者ID:liuguogen,項目名稱:weixin,代碼行數:34,代碼來源:BackAction.class.php

示例12: D

 function _initialize()
 {
     parent::_initialize();
     $dao = D('User');
     $user = $dao->find($this->mid);
     $this->assign('user', $user);
 }
開發者ID:skiman100,項目名稱:thinksns,代碼行數:7,代碼來源:AccountAction.class.php

示例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;
		}
	}
開發者ID:kevicki,項目名稱:pig,代碼行數:27,代碼來源:AllinpayAction.class.php

示例14: M

 function _initialize()
 {
     parent::_initialize();
     $this->dao = M('User');
     $this->assign('bcid', 0);
     $_POST = get_safe_replace($_POST);
 }
開發者ID:bossyuetao,項目名稱:yuephp,代碼行數:7,代碼來源:LoginAction.class.php

示例15: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $info = M('function_master')->where(array('class' => 1))->order('orderno asc')->select();
     $info = $this->convertLinks($info);
     //加外鏈等信息
 }
開發者ID:dalinhuang,項目名稱:website-of-huai,代碼行數:7,代碼來源:HuaiAction.class.php


注:本文中的BaseAction::_initialize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。