本文整理匯總了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);
//加外鏈等信息
}