Esempio n. 1
0
 /**
  * 初始化,那些页面需要
  * @author gongfei
  *
  * @access  public
  *
  * @return 跳转页面
  */
 public function _initialize()
 {
     parent::_initialize();
     //登录,退出方法需要得到登录状态
     $loginInfo = $this->hasAdminLogin();
     $filterLogin = array('logout');
     if (in_array(ACTION_NAME, $filterLogin)) {
         if (!$loginInfo['status']) {
             return $this->error($loginInfo['msg'], U('YbirdsAdmin/Public/index'));
         }
     }
     // 登录后不可访问的action
     $filterAction = array('index', 'login');
     if (in_array(ACTION_NAME, $filterAction) && $loginInfo['status']) {
         $this->redirect('YbirdsAdmin/Index/index');
     }
 }
 /**
  * 检查权限.
  * 
  * @access public
  * {@inheritDoc}
  * @see \YbirdsAdmin\Controller\CommonController::_initialize()
  */
 public function _initialize()
 {
     parent::_initialize();
     checkPower('12');
 }