2010年11月5日星期五

[fw-auth] Re: Validating Password while logged in and not loosing session

You are right.

That didn't even occur to me when I was looking over the code.

Zend_Auth doesn't do much more than:

1. Call the Auth_Adaptors "authenticate()" method
2. Clear the identity (storage) if it exists
3. Write new storage if validate is true
4. Return the Auth_Result that came from the Auth_Adaptor in step 1.

So, in my Account model, where I'm processing this, I just have a parameter
set for $clear_storage.

if($clear_storage) {
$result = $auth->authenticate($authAdapter);
} else {
$result = $authAdapter->authenticate();
}
return $result->isValid();

Which I suppose could write it a little more compactly as:

$result = $clear_storage ? $auth->authenticate($authAdapter) : $result =
$authAdapter->authenticate();
return $result;

Thanks much!
John
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Validating-Password-while-logged-in-and-not-loosing-session-tp3028677p3029369.html
Sent from the Zend Auth mailing list archive at Nabble.com.

没有评论: