修复登录“记住我”功能(ticket #151)
This commit is contained in:
parent
6ceff06d1a
commit
a3fbdb2e20
|
@ -162,15 +162,15 @@ class AccountController extends Zend_Controller_Action
|
||||||
->setIdentityColumn('username')
|
->setIdentityColumn('username')
|
||||||
->setCredentialColumn('password');
|
->setCredentialColumn('password');
|
||||||
$authAdapter->setIdentity($u)->setCredential(md5($p));
|
$authAdapter->setIdentity($u)->setCredential(md5($p));
|
||||||
if ($this->_request->getParam('remember')) {
|
|
||||||
$authNamespace = new Zend_Session_Namespace('westdc');
|
|
||||||
$authNamespace->setExpirationSeconds(2592000);
|
|
||||||
}
|
|
||||||
$result = $auth->authenticate($authAdapter);
|
$result = $auth->authenticate($authAdapter);
|
||||||
if ($result->isValid()) {
|
if ($result->isValid()) {
|
||||||
// success: store database row to auth's storage
|
// success: store database row to auth's storage
|
||||||
$data = $authAdapter->getResultRowObject(null,'password');
|
$data = $authAdapter->getResultRowObject(null,'password');
|
||||||
$auth->getStorage()->write($data);
|
$auth->getStorage()->write($data);
|
||||||
|
if ($this->_request->getParam('remember')) {
|
||||||
|
$authNamespace = new Zend_Session_Namespace('westdc');
|
||||||
|
$authNamespace->setExpirationSeconds(2592000);
|
||||||
|
}
|
||||||
$db->query("update users set ts_last_login=now() where username=?",array($u));
|
$db->query("update users set ts_last_login=now() where username=?",array($u));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue