From c31d8e9959efade437fb0a661f6f44329cc74664 Mon Sep 17 00:00:00 2001
From: Simon
Date: Tue, 19 Apr 2011 15:43:00 +0200
Subject: Code autoformatiert
---
.../modules/user/controllers/AuthController.php | 57 ++++++++++------------
1 file changed, 25 insertions(+), 32 deletions(-)
(limited to 'application/modules/user/controllers/AuthController.php')
diff --git a/application/modules/user/controllers/AuthController.php b/application/modules/user/controllers/AuthController.php
index 7fc199a..4a5bcf4 100644
--- a/application/modules/user/controllers/AuthController.php
+++ b/application/modules/user/controllers/AuthController.php
@@ -41,39 +41,32 @@ class User_AuthController extends Zend_Controller_Action
$auth = Zend_Auth::getInstance();
- $adapter = new Zend_Auth_Adapter_DbTable(
- $this->db,
- 'pbs_person',
- 'email',
- 'password',
- 'MD5(CONCAT(?, password_salt))'
- );
-
+ $adapter = new Zend_Auth_Adapter_DbTable( $this->db, 'pbs_person', 'email', 'password', 'MD5(CONCAT(?, password_salt))');
+
+ $adapter->setIdentity($loginForm->getValue('email'));
+ $adapter->setCredential($loginForm->getValue('password'));
- $adapter->setIdentity($loginForm->getValue('email'));
- $adapter->setCredential($loginForm->getValue('password'));
+ $result = $auth->authenticate($adapter);
- $result = $auth->authenticate($adapter);
-
- if ($result->isValid()) {
- $this->personmapper = new Application_Model_PersonMapper();
- $result = $this->personmapper->findBy(array('email' => Zend_Auth::getInstance()->getIdentity()),true);
- $person = new Application_Model_Person($result[0]);
- $person->setID($result[0]['personID']);
- $date = new DateTime();
- $person->setLogindate($date->getTimestamp());
- if($person->getSuspended()) {
- $pbsNotifier = new Pbs_Notifier();
- $this->view->notification = $pbsNotifier->notify('Your Account is suspended', 'error');
- } else {
- $this->personmapper->save($person);
- $this->_helper->redirector('selectmembership', 'person');
- return;
- }
- } else {
- $pbsNotifier = new Pbs_Notifier();
- $this->view->notification = $pbsNotifier->notify('Wrong Email or Password', 'error');
- }
+ if ($result->isValid()) {
+ $this->personmapper = new Application_Model_PersonMapper();
+ $result = $this->personmapper->findBy(array('email' => Zend_Auth::getInstance()->getIdentity()),true);
+ $person = new Application_Model_Person($result[0]);
+ $person->setID($result[0]['personID']);
+ $date = new DateTime();
+ $person->setLogindate($date->getTimestamp());
+ if($person->getSuspended()) {
+ $pbsNotifier = new Pbs_Notifier();
+ $this->view->notification = $pbsNotifier->notify('Your Account is suspended', 'error');
+ } else {
+ $this->personmapper->save($person);
+ $this->_helper->redirector('selectmembership', 'person');
+ return;
+ }
+ } else {
+ $pbsNotifier = new Pbs_Notifier();
+ $this->view->notification = $pbsNotifier->notify('Wrong Email or Password', 'error');
+ }
}
}
$this->view->loginForm = $loginForm;
@@ -235,7 +228,7 @@ class User_AuthController extends Zend_Controller_Action
$name = $person->getFirstname() . ' ' . $person->getName();
$url = $this->getRequest()->getScheme() . '://' . $this->getRequest()->getHttpHost() . $this->view->url();
$recoveryid = randomString(100);
- $mailbody = 'Um das Passwort zu ändern klicken Sie auf folgenden Link
Passwort ändern';
+ $mailbody = 'Um das Passwort zu ändern klicken Sie auf folgenden Link
Passwort ändern';
$mail = new Zend_Mail();
$mail->setBodyHtml($mailbody, 'utf8');
$mail->getBodyHtml()->getContent();
--
cgit v1.2.3-55-g7522