summaryrefslogtreecommitdiffstats
path: root/application/modules/fbgui/controllers
diff options
context:
space:
mode:
authorSimon2011-04-19 17:25:09 +0200
committerSimon2011-04-19 17:25:09 +0200
commit4223800a7a62eaa6148d7e96e87593e8913150cf (patch)
treef4394fd043ceeaf664500d05b90ab9dcec7ad743 /application/modules/fbgui/controllers
parentTicket #215 - Shutdown Button hinzugefügt (diff)
downloadpbs2-4223800a7a62eaa6148d7e96e87593e8913150cf.tar.gz
pbs2-4223800a7a62eaa6148d7e96e87593e8913150cf.tar.xz
pbs2-4223800a7a62eaa6148d7e96e87593e8913150cf.zip
Logout in der FBGui eingebaut
Diffstat (limited to 'application/modules/fbgui/controllers')
-rw-r--r--application/modules/fbgui/controllers/AuthController.php51
-rw-r--r--application/modules/fbgui/controllers/IndexController.php6
2 files changed, 26 insertions, 31 deletions
diff --git a/application/modules/fbgui/controllers/AuthController.php b/application/modules/fbgui/controllers/AuthController.php
index c811b06..936aa61 100644
--- a/application/modules/fbgui/controllers/AuthController.php
+++ b/application/modules/fbgui/controllers/AuthController.php
@@ -39,35 +39,29 @@ class Fbgui_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'));
-
- $result = $auth->authenticate($adapter);
-
- // TODO: erweiterte fehlerbeschreibung des Users
-
- 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());
- $this->personmapper->save($person);
- $this->_helper->redirector('selectmembership', 'person');
- return;
- } else {
- echo "Wrong Email or Password.";
- }
+ $adapter->setIdentity($loginForm->getValue('email'));
+ $adapter->setCredential($loginForm->getValue('password'));
+
+ $result = $auth->authenticate($adapter);
+
+ // TODO: erweiterte fehlerbeschreibung des Users
+
+ 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());
+ $this->personmapper->save($person);
+ $this->_helper->redirector('selectmembership', 'person');
+ return;
+ } else {
+ echo "Wrong Email or Password.";
+ }
}
}
$this->view->loginForm = $loginForm;
@@ -81,7 +75,8 @@ class Fbgui_AuthController extends Zend_Controller_Action
$auth->clearIdentity();
Zend_Session::namespaceUnset('userIDs');
Zend_Session::forgetMe();
- $this->_helper->redirector('login', 'auth');
+ $this->_redirect('/fbgui/index');
+# $this->_helper->redirector('fbgui', 'index');
return;
}
}
diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php
index 26f12fb..ab146d3 100644
--- a/application/modules/fbgui/controllers/IndexController.php
+++ b/application/modules/fbgui/controllers/IndexController.php
@@ -135,9 +135,9 @@ class Fbgui_IndexController extends Zend_Controller_Action
// 'Your alphasessionID is '.$session->getAlphasessionID(),
// 'Your client is '.$session->getClientID(),
// 'there is no bootmenu for you');
-
- $pbsNotifier = new Pbs_Notifier();
- $this->view->notification = $pbsNotifier->notify("There is no BootMenu to show. Please log in to get your BootMenu.<br />Click here to <a href='/fbgui/auth/login/'>login</a>",'error');
+ $this->view->nobootmenu = true;
+ #$pbsNotifier = new Pbs_Notifier();
+ #$this->view->notification = $pbsNotifier->notify("There is no BootMenu to show. Please log in to get your BootMenu.<br />Click here to <a href='/fbgui/auth/login/'>login</a>",'error');
}
}