Example #1
0
 public function authenticate()
 {
     try {
         $this->adminUser = Adminuser::authenticate($this->username, $this->password);
         return $this->createResult(Zend_Auth_Result::SUCCESS);
     } catch (Exception $e) {
         if ($e->getMessage() == Adminuser::INVALID_PASSWORD) {
             return $this->createResult(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, array(self::WRONG_PASSWORD_MSG));
         }
         if ($e->getMessage() == Adminuser::INVALID_CREDENTIALS) {
             return $this->createResult(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, array(self::NOT_FOUND_MSG));
         }
         return $this->createResult(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, array(self::ERROR_AUTH));
     }
 }