X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=application%2Fcontrollers%2FLoginController.php;h=4c8aca05771e224d0ed73629fab566998d589d2b;hb=e534c17db2f3986751f4a96900e4aaae56d34873;hp=ce9db39dd07d217e058728ccb1a0ee704bcb26b2;hpb=70d6bb9dfa4c198607fbe75592f108bc8d69048b;p=syj.git diff --git a/application/controllers/LoginController.php b/application/controllers/LoginController.php index ce9db39..4c8aca0 100644 --- a/application/controllers/LoginController.php +++ b/application/controllers/LoginController.php @@ -1,5 +1,5 @@ setIdentity($formData['login_user']) - ->setCredential(sha1($formData['login_password'])); - - $auth = Zend_Auth::getInstance(); - $result = $auth->authenticate($authAdapter); - if (!$result->isValid()) { + if (!$this->_helper->SyjUserManager->validate($formData['login_user'], + sha1($formData['login_password']), + $formData['login_rememberme'])) { if ($httprequest) { throw new Syj_Exception_Forbidden(); } else { @@ -49,9 +43,7 @@ class LoginController extends Zend_Controller_Action } } - $userid = $authAdapter->getResultRowObject('id')->id; - $this->_helper->SyjSession->login($userid); - $user = $this->_helper->SyjSession->user(); + $user = $this->_helper->SyjUserManager->current(); if ($httprequest) { $api = $this->_helper->SyjApi->setCode(200); @@ -75,7 +67,7 @@ class LoginController extends Zend_Controller_Action } public function logoutAction() { - $this->_helper->SyjSession->logout(); + $this->_helper->SyjUserManager->logout(); $this->redirect(); }