コード例 #1
0
ファイル: NgsAdminUser.class.php プロジェクト: pars5555/crm
 /**
  * Validates user credentials
  *
  * @return TRUE - if validation passed, and FALSE - otherwise
  */
 public function validate()
 {
     if (AdminManager::getInstance()->validate($this->getId(), $this->getUniqueId())) {
         return true;
     }
     throw new InvalidUserException("wrong user");
 }
コード例 #2
0
ファイル: LoginAction.class.php プロジェクト: pars5555/crm
 public function service()
 {
     $adminDto = AdminManager::getInstance()->getByUsernamePassword(NGS()->args()->getUsername(), md5(NGS()->args()->getPassword()));
     if (!$adminDto) {
         $this->redirect('login');
     }
     NGS()->getSessionManager()->login(UserGroups::$ADMIN, $adminDto->getId());
     $this->redirect('');
 }