]> source.dussan.org Git - nextcloud-server.git/commitdiff
check number of members after potential resolving of rdns
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Fri, 27 Nov 2020 17:44:27 +0000 (18:44 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 15 Dec 2020 21:37:54 +0000 (21:37 +0000)
- the type check is not necessary anymore for the return type of
  _groupMembers()

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
apps/user_ldap/lib/Group_LDAP.php

index 9cedbbadf560edabeed28c64a23480e0047bcfc2..be2fbecad853e563abaf3b326e2ce7e5337d842c 100644 (file)
@@ -136,10 +136,6 @@ class Group_LDAP extends BackendUtility implements GroupInterface, IGroupLDAP, I
 
                //usually, LDAP attributes are said to be case insensitive. But there are exceptions of course.
                $members = $this->_groupMembers($groupDN);
-               if (!is_array($members) || count($members) === 0) {
-                       $this->access->connection->writeToCache($cacheKey, false);
-                       return false;
-               }
 
                //extra work if we don't get back user DNs
                switch ($this->ldapGroupMemberAssocAttr) {
@@ -186,6 +182,11 @@ class Group_LDAP extends BackendUtility implements GroupInterface, IGroupLDAP, I
                                break;
                }
 
+               if (count($members) === 0) {
+                       $this->access->connection->writeToCache($cacheKey, false);
+                       return false;
+               }
+
                $isInGroup = in_array($userDN, $members);
                $this->access->connection->writeToCache($cacheKey, $isInGroup);
                $this->access->connection->writeToCache($cacheKeyMembers, $members);