From 8c532efd5f02f7a7e5ea322a07ddcf49d130a8ec Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 17 Oct 2015 10:09:03 -0400 Subject: Run php-cs-fixer on the code base --- app/Auth/Ldap.php | 23 ++++++++--------------- app/Auth/RememberMe.php | 2 -- 2 files changed, 8 insertions(+), 17 deletions(-) (limited to 'app/Auth') diff --git a/app/Auth/Ldap.php b/app/Auth/Ldap.php index 78820d2e..687762d3 100644 --- a/app/Auth/Ldap.php +++ b/app/Auth/Ldap.php @@ -217,7 +217,6 @@ class Ldap extends Base $result = $this->findUser($username, $password); if (is_array($result)) { - $user = $this->user->getByUsername($username); if (! empty($user)) { @@ -226,14 +225,12 @@ class Ldap extends Base if ($user['is_ldap_user'] == 0) { return false; } - } - else { + } else { // We create automatically a new user if ($this->isLdapAccountCreationEnabled() && $this->user->create($result) !== false) { $user = $this->user->getByUsername($username); - } - else { + } else { return false; } } @@ -319,12 +316,10 @@ class Ldap extends Base if ($this->getLdapBindType() === 'user') { $ldap_username = sprintf($this->getLdapUsername(), $username); $ldap_password = $password; - } - else if ($this->getLdapBindType() === 'proxy') { + } elseif ($this->getLdapBindType() === 'proxy') { $ldap_username = $this->getLdapUsername(); $ldap_password = $this->getLdapPassword(); - } - else { + } else { $ldap_username = null; $ldap_password = null; } @@ -486,11 +481,9 @@ class Ldap extends Base { if (! empty($username) && ! empty($email)) { return '(&('.$this->getLdapUserPattern($username).')('.$this->getLdapAccountEmail().'='.$email.'))'; - } - else if (! empty($username)) { + } elseif (! empty($username)) { return $this->getLdapUserPattern($username); - } - else if (! empty($email)) { + } elseif (! empty($email)) { return '('.$this->getLdapAccountEmail().'='.$email.')'; } @@ -508,7 +501,7 @@ class Ldap extends Base */ private function getEntry(array $entries, $key, $default = '') { - return isset($entries[0][$key][0]) ? $entries[0][$key][0] : $default; + return isset($entries[0][$key][0]) ? $entries[0][$key][0] : $default; } /** @@ -522,6 +515,6 @@ class Ldap extends Base */ private function getEntries(array $entries, $key, $default = array()) { - return isset($entries[0][$key]) ? $entries[0][$key] : $default; + return isset($entries[0][$key]) ? $entries[0][$key] : $default; } } diff --git a/app/Auth/RememberMe.php b/app/Auth/RememberMe.php index 6569463d..bba2bda6 100644 --- a/app/Auth/RememberMe.php +++ b/app/Auth/RememberMe.php @@ -88,7 +88,6 @@ class RememberMe extends Base $credentials = $this->readCookie(); if ($credentials !== false) { - $record = $this->find($credentials['token'], $credentials['sequence']); if ($record) { @@ -144,7 +143,6 @@ class RememberMe extends Base $credentials = $this->readCookie(); if ($credentials !== false) { - $this->deleteCookie(); $this->db -- cgit v1.2.3