Example #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;
         }
     }
 }
Example #2
0
 protected function setAccountStorage($accountname, $camefrom)
 {
     $this->account = \Prj\Data\Manager::getCopy($accountname, $camefrom);
 }
Example #3
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);
         }
     }
 }
Example #4
0
 /**
  * 启用某账号
  */
 public function enableAction()
 {
     $where = \Lib\Misc\DWZ::decodePkey($this->_request->get('_pkey_val'));
     $manager = \Prj\Data\Manager::getCopy($where['loginname'], $where['camefrom']);
     $manager->load();
     if (!empty($where)) {
         try {
             $manager->setField('dtForbidden', 0);
             $manager->update();
             $ret = true;
         } catch (\ErrorException $e) {
             $ret = false;
         }
     } else {
         $ret = false;
     }
     if ($ret) {
         $this->returnOK('已启用');
     } else {
         $this->returnError('删除失败');
     }
 }