From 7abf17f09c3c5f493d5d4c8e72500d9204c1cece Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 31 Jan 2011 10:58:14 +0100 Subject: authController hinzugefügt --- application/controllers/AuthController.php | 43 ++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 application/controllers/AuthController.php (limited to 'application/controllers/AuthController.php') diff --git a/application/controllers/AuthController.php b/application/controllers/AuthController.php new file mode 100644 index 0000000..fa228ea --- /dev/null +++ b/application/controllers/AuthController.php @@ -0,0 +1,43 @@ +_getParam('db'); + + $loginForm = new Default_Form_Auth_Login($_POST); + + if ($loginForm->isValid()) { + + $adapter = new Zend_Auth_Adapter_DbTable( + $db, + 'users', + 'username', + 'password', + 'MD5(CONCAT(?, password_salt))' + ); + + $adapter->setIdentity($loginForm->getValue('email')); + $adapter->setCredential($loginForm->getValue('password')); + + $result = $auth->authenticate($adapter); + + if ($result->isValid()) { + $this->_helper->FlashMessenger('Erfolgreich angemeldet'); + $this->redirect('/'); + return; + } + + } + + $this->view->loginForm = $loginForm; + + } + + +} + + + -- cgit v1.2.3-55-g7522