Example #1
0
 public function init()
 {
     parent::init();
     if (isset($_POST['sessionId'])) {
         $session = Yii::app()->getSession();
         $session->close();
         $session->sessionID = $_POST['sessionId'];
         $session->open();
     }
     $this->_admini = parent::_sessionGet('_admini');
     if (empty($this->_admini['userId'])) {
         $this->redirect(array('public/login'));
     }
     //栏目
     $this->_catalog = Catalog::model()->findAll();
 }
Example #2
0
 /**
  * 初始化
  * @see CController::init()
  */
 public function init()
 {
     parent::init();
     if (isset($_POST['sessionId'])) {
         $session = Yii::app()->getSession();
         $session->close();
         $session->sessionID = $_POST['sessionId'];
         $session->open();
     }
     $this->_account = parent::_sessionGet('_account');
     //栏目
     $this->_catalog = Catalog::model()->findAll();
     //检测系统是否已经安装
     if (!is_file(WWWPATH . DS . 'data' . DS . 'install.lock')) {
         $this->redirect(array('/install'));
     }
 }
Example #3
0
 public function init()
 {
     //初始化
     parent::init();
     //更新session
     if (isset($_POST['sessionId'])) {
         $session = Yii::app()->getSession();
         $session->close();
         $session->sessionID = $_POST['sessionId'];
         $session->open();
     }
     //从初始化的内容里面取的userid,若存在则证明有登录
     $this->_backendUserId = parent::_sessionGet('uid');
     $this->_backendUserName = parent::_sessionGet('uname');
     $this->_backendGroupId = parent::_sessionGet('_backendGroupId');
     /* 检测判断是否登陆,否则跳到login页面 */
     empty($this->_backendUserId) && $this->redirect(array('public/login'));
     empty($this->_backendGroupId) && $this->redirect(array('public/login'));
     $this->_backendGroupName = parent::_sessionGet('_backendGroupName');
     $this->_backendPermission = parent::_sessionGet('_backendPermission');
     $this->_backendAcl = parent::_sessionGet('_backendAcl');
     if (empty($this->_backendAcl) || empty($this->_backendGroupName)) {
         $groupArr = AdminGroup::model()->findByPk($this->_backendGroupId);
         //当前组权限
         $this->_backendAcl = $groupArr->acl;
         parent::_sessionSet('_backendAcl', $this->_backendAcl);
         //当前组id
         $this->_backendGroupId = $groupArr->id;
         parent::_sessionSet('_backendGroupId', $this->_backendGroupId);
         //当前组名
         $this->_backendGroupName = $groupArr->group_name;
         parent::_sessionSet('_backendGroupName', $this->_backendGroupName);
         unset($groupArr);
     }
     //栏目,后端在此获得全分类数组,前端在system里面获得
     $this->_catalog = XXcache::get('_catalog');
     $this->_catalogAll = XXcache::get('_catalogAll');
     //系统配置
     $this->_conf = XXcache::get('_config');
     $this->_theme = empty($this->_conf['theme']) ? 'default' : $this->_conf['theme'];
     //        $this->_conf = self::_config();
     //站点前台主题静态目录url
     !defined('STATIC_THEME_URL') && define('STATIC_THEME_URL', SITE_URL . 'static/themes/' . $this->_theme . '/');
 }
Example #4
0
 /**
  * 会员登录
  */
 public function actionTestLogin()
 {
     parent::_stateWrite(array($this->module->id . 'Id' => '11', 'userName' => 'testest'), array('prefix' => '_' . $this->module->id));
     print_r(parent::_sessionGet('_' . $this->module->id));
 }