From deb71ec9e2f6b67761d34c866741ce845599b42e Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Tue, 8 Oct 2013 07:50:42 +0100 Subject: [PATCH] Fixes #125 --- PHPCI/Controller/SessionController.php | 5 +++++ PHPCI/View/Session/login.phtml | 3 +++ 2 files changed, 8 insertions(+) diff --git a/PHPCI/Controller/SessionController.php b/PHPCI/Controller/SessionController.php index 06773305..0c463132 100644 --- a/PHPCI/Controller/SessionController.php +++ b/PHPCI/Controller/SessionController.php @@ -30,6 +30,8 @@ class SessionController extends \PHPCI\Controller */ public function login() { + $isLoginFailure = false; + if ($this->request->getMethod() == 'POST') { $user = $this->_userStore->getByEmail($this->getParam('email')); @@ -37,6 +39,8 @@ class SessionController extends \PHPCI\Controller $_SESSION['user_id'] = $user->getId(); header('Location: ' . PHPCI_URL); die; + } else { + $isLoginFailure = true; } } @@ -64,6 +68,7 @@ class SessionController extends \PHPCI\Controller $form->addField($pwd); $this->view->form = $form->render(); + $this->view->failed = $isLoginFailure; return $this->view->render(); } diff --git a/PHPCI/View/Session/login.phtml b/PHPCI/View/Session/login.phtml index adcc8210..59027b0e 100644 --- a/PHPCI/View/Session/login.phtml +++ b/PHPCI/View/Session/login.phtml @@ -78,6 +78,9 @@
+ +

Incorrect email address or password

+