]> BookStack Code Mirror - bookstack/blobdiff - app/Services/LdapService.php
Update Ldap.php
[bookstack] / app / Services / LdapService.php
index 84883b09a20fa9422956578fa48d6909e7f14682..b7f101ad2c3a9088357941df9c042eb973081dcb 100644 (file)
@@ -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;