_username = $username; $this->_password = $password; } public function authenticate() { //@todo faire une requĂȘte getInfosLogin $usersPassword = array( 'mricois' => 'bj10sx', 'ylenaour' => 'bzh4231*', 'altisys' => 'fortest', 'oseo' => 'oseo', 'sbeaugrand' => 'Esoptron', ); //Login inexistant if (!array_key_exists($this->_username, $usersPassword)) { return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, $this->_username); //Mot de pass incorrect } elseif (array_key_exists($this->_username, $usersPassword) && $usersPassword[$this->_username] != $this->_password ) { return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, $this->_username); //Ok tout est bon } elseif (array_key_exists($this->_username, $usersPassword) && $usersPassword[$this->_username] == $this->_password ) { return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $this->_username); //... } else { return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_UNCATEGORIZED, $this->_username); } } }