diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-10-08 22:18:34 +0300 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2015-10-08 22:18:34 +0300 |
commit | a876efda50680f7d8652299cb5265dc552be45cf (patch) | |
tree | fe6f0ed2bbfc8e22a9419c74ce5e4d32fa5c08aa /apps/user_ldap | |
parent | dd2e887a8d9be9cb95a52582612bf95e2f8eb247 (diff) |
treat dn as any other attribute when building the search() return array
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/group_ldap.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/access.php | 6 | ||||
-rw-r--r-- | apps/user_ldap/user_ldap.php | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index 200ee6ea4ab..0b9c9d9d5f0 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -491,7 +491,7 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { array($this->access->connection->ldapGroupDisplayName, 'dn')); if (is_array($groups)) { foreach ($groups as $groupobj) { - $groupDN = $groupobj['dn']; + $groupDN = $groupobj['dn'][0]; $allGroups[$groupDN] = $groupobj; $nestedGroups = $this->access->connection->ldapNestedGroups; if (!empty($nestedGroups)) { diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 1809700b1be..adfb11da673 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -532,7 +532,7 @@ class Access extends LDAPUtility implements user\IUserTools { $nameByLDAP = $ldapObject[$nameAttribute][0]; } - $ocName = $this->dn2ocname($ldapObject['dn'], $nameByLDAP, $isUsers); + $ocName = $this->dn2ocname($ldapObject['dn'][0], $nameByLDAP, $isUsers); if($ocName) { $ownCloudNames[] = $ocName; if($isUsers) { @@ -692,7 +692,7 @@ class Access extends LDAPUtility implements user\IUserTools { */ public function batchApplyUserAttributes(array $ldapRecords){ foreach($ldapRecords as $userRecord) { - $ocName = $this->dn2ocname($userRecord['dn'], $userRecord[$this->connection->ldapUserDisplayName]); + $ocName = $this->dn2ocname($userRecord['dn'][0], $userRecord[$this->connection->ldapUserDisplayName]); $this->cacheUserExists($ocName); $user = $this->userManager->get($ocName); $user->processAttributes($userRecord); @@ -1012,7 +1012,7 @@ class Access extends LDAPUtility implements user\IUserTools { $this->sanitizeDN($item[$key]) : $item[$key]; } else { - $selection[$i][$key] = $this->sanitizeDN($item[$key]); + $selection[$i][$key] = [$this->sanitizeDN($item[$key])]; } } diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php index 59c61524c9b..fc8ce361637 100644 --- a/apps/user_ldap/user_ldap.php +++ b/apps/user_ldap/user_ldap.php @@ -78,7 +78,7 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn public function loginName2UserName($loginName) { try { $ldapRecord = $this->getLDAPUserByLoginName($loginName); - $user = $this->access->userManager->get($ldapRecord['dn']); + $user = $this->access->userManager->get($ldapRecord['dn'][0]); if($user instanceof OfflineUser) { return false; } @@ -119,7 +119,7 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn } catch(\Exception $e) { return false; } - $dn = $ldapRecord['dn']; + $dn = $ldapRecord['dn'][0]; $user = $this->access->userManager->get($dn); if(!$user instanceof User) { |