Fixes #125
This commit is contained in:
parent
cc09d95a3d
commit
deb71ec9e2
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -78,6 +78,9 @@
|
|||
<img src="<?php print PHPCI_URL; ?>/assets/img/logo-large.png">
|
||||
</a>
|
||||
<div class="" id="login-box">
|
||||
<?php if($failed): ?>
|
||||
<p class="alert alert-danger">Incorrect email address or password</p>
|
||||
<?php endif; ?>
|
||||
<?php print $form; ?>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue