diff options
Diffstat (limited to 'application/controllers/AuthController.php')
| -rw-r--r-- | application/controllers/AuthController.php | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/application/controllers/AuthController.php b/application/controllers/AuthController.php index 070c2e8..cc0bca2 100644 --- a/application/controllers/AuthController.php +++ b/application/controllers/AuthController.php @@ -12,6 +12,9 @@ class AuthController extends Zend_Controller_Action $loginForm = new Application_Form_AuthLogin($_POST); if ($loginForm->isValid($_POST)) { + + $auth = Zend_Auth::getInstance(); + $adapter = new Zend_Auth_Adapter_DbTable( $db, 'pbs_person', @@ -19,20 +22,19 @@ class AuthController extends Zend_Controller_Action 'password', 'MD5(CONCAT(?, password_salt))' ); - + + $adapter->setIdentity($loginForm->getValue('email')); $adapter->setCredential($loginForm->getValue('password')); - - $result = $adapter->authenticate(); - + + $result = $auth->authenticate($adapter); + + // TODO: erweiterte fehlerbeschreibung des Users + // siehe http://framework.zend.com/manual/en/zend.auth.introduction.html + if ($result->isValid()) { - //$this->_helper->FlashMessenger('Erfolgreich angemeldet'); - $this->_userNamespace->username = 'testt'; - - Zend_Debug::dump($_SESSION, $label="_SESSION nach Login: ", $echo=true); - Zend_Debug::dump($this->_userNamespace, $label="userNamespace: ", $echo=true); - $this->view->loginStatus = "Eingeloggt als " . $this->_userNamespace->username; - #$this->_redirect('/'); + #$this->_helper->FlashMessenger('Erfolgreich angemeldet'); + $this->_redirect('/'); return; } else { //$this->_helper->FlashMessenger('E-Mail oder Passwort falsch'); |
