My guess is that Model_User::authenticate() throws an exception that is not
handled by the two if's in the catch block (i.e. $e->getMessage() is neither
NOT_FOUND nor WRONG_PW). I'd suggest you add a "throw $e;" after the second
if block inside the catch to see exactly what the model threw. Would also
help if we could see the Model_User class.
-- Mon
On Mon, Jul 12, 2010 at 8:54 PM, MrMastermindNL
<[email protected]>wrote:
>
> 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.
>