Thanks for your reply Mon, here's my adapter class, maybe you can tell me
what is missing here:
class RS_Auth_Adapter implements Zend_Auth_Adapter_Interface
{
const NOT_FOUND_MSG = 'Account not found';
const BAD_PW_MSG = 'Password in invalid';
protected $user = null;
protected $username = '';
protected $password = '';
public function __construct($username, $password)
{
$this->username = $username;
$this->password = $password;
}
/**
* @throws Zend_Auth_Adapter_Exception
* @returns Zend_Auth_Result
*/
public function authenticate()
{
try
{
$this->user = Model_User::authenticate($this->username,
$this->password);
return $this->createResult(Zend_Auth_Result::SUCCESS);
}
catch(Exception $e)
{
if($e->getMessage() == Model_User::WRONG_PW)
return
$this->createResult(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID,
array(self::BAD_PW_MSG));
if($e->getMessage() == Model_User::NOT_FOUND)
return
$this->createResult(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND,
array(self::NOT_FOUND_MSG));
}
}
private function createResult($code, $messages = array())
{
return new Zend_Auth_Result($code, $this->user, $messages);
}
}
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/Zend-Auth-session-expired-fatal-error-tp2225703p2286085.html
Sent from the Zend Framework mailing list archive at Nabble.com.