Fixes #125
This commit is contained in:
parent
cc09d95a3d
commit
deb71ec9e2
|
@ -30,6 +30,8 @@ class SessionController extends \PHPCI\Controller
|
||||||
*/
|
*/
|
||||||
public function login()
|
public function login()
|
||||||
{
|
{
|
||||||
|
$isLoginFailure = false;
|
||||||
|
|
||||||
if ($this->request->getMethod() == 'POST') {
|
if ($this->request->getMethod() == 'POST') {
|
||||||
$user = $this->_userStore->getByEmail($this->getParam('email'));
|
$user = $this->_userStore->getByEmail($this->getParam('email'));
|
||||||
|
|
||||||
|
@ -37,6 +39,8 @@ class SessionController extends \PHPCI\Controller
|
||||||
$_SESSION['user_id'] = $user->getId();
|
$_SESSION['user_id'] = $user->getId();
|
||||||
header('Location: ' . PHPCI_URL);
|
header('Location: ' . PHPCI_URL);
|
||||||
die;
|
die;
|
||||||
|
} else {
|
||||||
|
$isLoginFailure = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,6 +68,7 @@ class SessionController extends \PHPCI\Controller
|
||||||
$form->addField($pwd);
|
$form->addField($pwd);
|
||||||
|
|
||||||
$this->view->form = $form->render();
|
$this->view->form = $form->render();
|
||||||
|
$this->view->failed = $isLoginFailure;
|
||||||
|
|
||||||
return $this->view->render();
|
return $this->view->render();
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,9 @@
|
||||||
<img src="<?php print PHPCI_URL; ?>/assets/img/logo-large.png">
|
<img src="<?php print PHPCI_URL; ?>/assets/img/logo-large.png">
|
||||||
</a>
|
</a>
|
||||||
<div class="" id="login-box">
|
<div class="" id="login-box">
|
||||||
|
<?php if($failed): ?>
|
||||||
|
<p class="alert alert-danger">Incorrect email address or password</p>
|
||||||
|
<?php endif; ?>
|
||||||
<?php print $form; ?>
|
<?php print $form; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue