示例#1
0
 /**
  * 改造:没登入的情况下不丢异常
  */
 protected function onInit_chkLogin()
 {
     $this->session = \Sooh\Base\Session\Data::getInstance();
     if ($this->session) {
         $userId = $this->session->get('managerId');
         if (!empty($userId)) {
             \Sooh\Base\Log\Data::getInstance()->userId = $userId;
             $this->manager = \Prj\Data\Manager::getCopyByManagerId($userId);
         } else {
             $this->manager = null;
         }
     }
 }
示例#2
0
 protected function onInit_chkLogin()
 {
     $this->session = \Sooh\Base\Session\Data::getInstance();
     if ($this->session) {
         $userId = $this->session->get('managerId');
         if ($userId) {
             \Sooh\Base\Log\Data::getInstance()->userId = $userId;
             $this->manager = \Prj\Data\Manager::getCopyByManagerId($userId);
             $this->manager->load();
             if (!$this->manager->acl->hasRightsFor($this->_request->getModuleName(), $this->_request->getControllerName())) {
                 $this->returnError(\Prj\ErrCode::errNoRights, 300);
             }
         } else {
             $this->returnError(\Prj\ErrCode::errNotLogin, 301);
         }
     }
 }