X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/7bcd967fd9a6dc25be81fcccbe7f1d4df17a7b3e..refs/pull/205/head:/app/Services/LdapService.php diff --git a/app/Services/LdapService.php b/app/Services/LdapService.php index 84883b09a..b7f101ad2 100644 --- a/app/Services/LdapService.php +++ b/app/Services/LdapService.php @@ -46,7 +46,7 @@ class LdapService $user = $users[0]; return [ - 'uid' => $user['uid'][0], + 'uid' => (isset($user['uid'])) ? $user['uid'][0] : $user['dn'], 'name' => $user['cn'][0], 'dn' => $user['dn'], 'email' => (isset($user['mail'])) ? $user['mail'][0] : null @@ -122,7 +122,7 @@ class LdapService // Set any required options if ($this->config['version']) { - $this->ldap->setOption($ldapConnection, LDAP_OPT_PROTOCOL_VERSION, $this->config['version']); + $this->ldap->setVersion($ldapConnection, $this->config['version']); } $this->ldapConnection = $ldapConnection;