summaryrefslogtreecommitdiff
path: root/app/Model/Authentication.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-10-17 10:09:03 -0400
committerFrederic Guillot <fred@kanboard.net>2015-10-17 10:09:03 -0400
commit8c532efd5f02f7a7e5ea322a07ddcf49d130a8ec (patch)
tree289222e21420b8d0092f06de097090f179202f6b /app/Model/Authentication.php
parentb40190ee9fd557d86e594208ed77fa762c7dcfb7 (diff)
Run php-cs-fixer on the code base
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());