summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers/AuthController.php
diff options
context:
space:
mode:
authorSimon2011-04-19 15:43:00 +0200
committerSimon2011-04-19 15:43:00 +0200
commitc31d8e9959efade437fb0a661f6f44329cc74664 (patch)
tree48afaad36266c251f3df4928ed18d6e09478413c /application/modules/user/controllers/AuthController.php
parentAufgeräumt und verschoben (diff)
downloadpbs2-c31d8e9959efade437fb0a661f6f44329cc74664.tar.gz
pbs2-c31d8e9959efade437fb0a661f6f44329cc74664.tar.xz
pbs2-c31d8e9959efade437fb0a661f6f44329cc74664.zip
Code autoformatiert
Diffstat (limited to 'application/modules/user/controllers/AuthController.php')
-rw-r--r--application/modules/user/controllers/AuthController.php57
1 files changed, 25 insertions, 32 deletions
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<br /><br /><a href="'. $url . '/auth/recoverpassword/?recoveryid='. $recoveryid . '">Passwort ändern</a>';
+ $mailbody = 'Um das Passwort zu ändern klicken Sie auf folgenden Link<br /><br /><a href="'. $url . '/auth/recoverpassword/?recoveryid='. $recoveryid . '">Passwort ändern</a>';
$mail = new Zend_Mail();
$mail->setBodyHtml($mailbody, 'utf8');
$mail->getBodyHtml()->getContent();