diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-02-20 13:54:28 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2015-04-13 11:50:09 +0200 |
commit | a418150470f9cae3ef727024e4e3dd4bfd31904c (patch) | |
tree | 59726c3b70d540893b61c1267cc014db50f5db8c /apps | |
parent | 66bc8145a99e5de7719eec3d2b19741b7424b23e (diff) | |
download | nextcloud-server-a418150470f9cae3ef727024e4e3dd4bfd31904c.tar.gz nextcloud-server-a418150470f9cae3ef727024e4e3dd4bfd31904c.zip |
fix and more robustness thx to scrutinizer
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/user_ldap.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php index 045b3d46e05..ad10a2bf95d 100644 --- a/apps/user_ldap/user_ldap.php +++ b/apps/user_ldap/user_ldap.php @@ -80,6 +80,9 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn try { $ldapRecord = $this->getLDAPUserByLoginName($loginName); $user = $this->access->userManager->get($ldapRecord['dn']); + if($user instanceof OfflineUser) { + return false; + } return $user->getUsername(); } catch (\Exception $e) { return false; @@ -140,7 +143,7 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn $dpn = $ldapRecord[$this->access->connection->ldapUserDisplayName]; $user->storeDisplayName($dpn); } - if(isset($users[0]['uid'])) { + if(isset($ldapRecord['uid'])) { $user->storeLDAPUserName($ldapRecord['uid']); } else if(isset($ldapRecord['samaccountname'])) { $user->storeLDAPUserName($ldapRecord['samaccountname']); |