aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-01-20 11:33:26 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-01-20 11:33:26 +0100
commitdd733d89256e0a2d1f7f4f96ac46b5a7bfbff984 (patch)
tree91538a65f378e461a5fb4317e246a382f8251b07 /apps/user_ldap/lib
parent5652981600c4b93f627083fa174cf062ec177043 (diff)
parent1ed61328991ce1071fc956a18ea3159405b0e6f3 (diff)
downloadnextcloud-server-dd733d89256e0a2d1f7f4f96ac46b5a7bfbff984.tar.gz
nextcloud-server-dd733d89256e0a2d1f7f4f96ac46b5a7bfbff984.zip
Merge pull request #20804 from owncloud/fix-ldap-process-user-wo-displayname
LDAP: do not attempt to process user records without display name, fi…
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r--apps/user_ldap/lib/access.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index 97f795483a9..82cd342ae2f 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -709,8 +709,16 @@ class Access extends LDAPUtility implements user\IUserTools {
* @param array $ldapRecords
*/
public function batchApplyUserAttributes(array $ldapRecords){
+ $displayNameAttribute = strtolower($this->connection->ldapUserDisplayName);
foreach($ldapRecords as $userRecord) {
+ if(!isset($userRecord[$displayNameAttribute])) {
+ // displayName is obligatory
+ continue;
+ }
$ocName = $this->dn2ocname($userRecord['dn'][0]);
+ if($ocName === false) {
+ continue;
+ }
$this->cacheUserExists($ocName);
$user = $this->userManager->get($ocName);
if($user instanceof OfflineUser) {