summaryrefslogtreecommitdiff
path: root/app/Auth/Ldap.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Auth/Ldap.php')
-rw-r--r--app/Auth/Ldap.php23
1 files changed, 8 insertions, 15 deletions
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;
}
}