Example #1
0
 /**
  * Performs an authentication attempt
  *
  * @throws Zend_Auth_Adapter_Exception If authentication cannot be performed.
  * @return Zend_Auth_Result
  */
 public function authenticate()
 {
     // Try to get the account information
     try {
         $account = new Opus_Account(null, null, $this->_login);
     } catch (Exception $ex) {
         return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, $this->_login, array('auth_error_invalid_credentials'));
     }
     // Check if password is correcct, but for old hashes.  Neede for
     // migrating md5-hashed passwords to SHA1-hashes.
     if ($account->isPasswordCorrectOldHash($this->_password) === true) {
         Zend_Registry::get('Zend_Log')->warn('Migrating old password-hash for user: '******'auth_login_success'));
     }
     return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, $this->_login, array('auth_error_invalid_credentials'));
 }