コード例 #1
0
ファイル: Adapter.php プロジェクト: bokultis/kardiomedika
 /**
  * @throws Zend_Auth_Adapter_Exception If authentication can not be establish
  * @return Zend_Auth_Result
  */
 public function authenticate()
 {
     $this->_admin = new Auth_Model_User();
     //invalid username
     if (!Auth_Model_UserMapper::getInstance()->findByCredentials($this->_auth, $this->_admin)) {
         return $this->createResult(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, self::NOT_FOUND_MESSAGE);
     }
     //invalid pass
     if ($this->_admin->get_password() != md5($this->_password)) {
         return $this->createResult(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, self::BAD_PW_MSG);
     }
     //not active
     if ($this->_admin->get_status() != 'active') {
         return $this->createResult(Zend_Auth_Result::FAILURE_UNCATEGORIZED, self::STATUS_NOT_ACTIVE);
     }
     return $this->createResult(Zend_Auth_Result::SUCCESS);
 }