summaryrefslogtreecommitdiff
path: root/app/Model/Authentication.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model/Authentication.php')
-rw-r--r--app/Model/Authentication.php11
1 files changed, 3 insertions, 8 deletions
diff --git a/app/Model/Authentication.php b/app/Model/Authentication.php
index acd563bc..116e0726 100644
--- a/app/Model/Authentication.php
+++ b/app/Model/Authentication.php
@@ -79,12 +79,10 @@ class Authentication extends Base
if ($this->user->isLocked($username)) {
$this->container['logger']->error('Account locked: '.$username);
return false;
- }
- else if ($this->backend('database')->authenticate($username, $password)) {
+ } elseif ($this->backend('database')->authenticate($username, $password)) {
$this->user->resetFailedLogin($username);
return true;
- }
- else if (LDAP_AUTH && $this->backend('ldap')->authenticate($username, $password)) {
+ } elseif (LDAP_AUTH && $this->backend('ldap')->authenticate($username, $password)) {
$this->user->resetFailedLogin($username);
return true;
}
@@ -133,11 +131,9 @@ class Authentication extends Base
list($result, $errors) = $this->validateFormCredentials($values);
if ($result) {
-
if ($this->validateFormCaptcha($values) && $this->authenticate($values['username'], $values['password'])) {
$this->createRememberMeSession($values);
- }
- else {
+ } else {
$result = false;
$errors['login'] = t('Bad username or password');
}
@@ -194,7 +190,6 @@ class Authentication extends Base
private function createRememberMeSession(array $values)
{
if (REMEMBER_ME_AUTH && ! empty($values['remember_me'])) {
-
$credentials = $this->backend('rememberMe')
->create($this->userSession->getId(), Request::getIpAddress(), Request::getUserAgent());