Fix message on failed authentication if user doesn't exist

This commit is contained in:
Matias Griese
2014-08-29 15:03:06 +03:00
parent eb6df1f343
commit 8241d8fe41

View File

@@ -114,8 +114,11 @@ class AdminController
*/
protected function taskLogin()
{
$this->admin->authenticate($this->post);
$this->admin->setMessage('You have been logged in.');
if ($this->admin->authenticate($this->post)) {
$this->admin->setMessage('You have been logged in.');
} else {
$this->admin->setMessage('Login failed.');
}
return true;
}
@@ -167,7 +170,7 @@ class AdminController
// Make sure theme exists (throws exception)
$name = !empty($this->post['theme']) ? $this->post['theme'] : '';
Themes::get($name);
$this->grav['themes']->get($name);
// Store system configuration.
$system = $this->admin->data('system');