This commit is contained in:
Dan Cryer 2013-10-08 07:50:42 +01:00
parent cc09d95a3d
commit deb71ec9e2
2 changed files with 8 additions and 0 deletions

View file

@ -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();
}

View file

@ -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>