diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2020-11-27 18:44:27 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2020-11-27 18:44:27 +0100 |
commit | 270912848fbdc735186ee43456b743fa89371da7 (patch) | |
tree | b952c09b80388b8d6aa6d1359d0223655dc5e5c8 | |
parent | 1f40ecca86d2c024116092f23ae8dbc5e50aa26d (diff) | |
download | nextcloud-server-270912848fbdc735186ee43456b743fa89371da7.tar.gz nextcloud-server-270912848fbdc735186ee43456b743fa89371da7.zip |
check number of members after potential resolving of rdns
- the type check is not necessary anymore for the return type of
_groupMembers()
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r-- | apps/user_ldap/lib/Group_LDAP.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php index 9cedbbadf56..be2fbecad85 100644 --- a/apps/user_ldap/lib/Group_LDAP.php +++ b/apps/user_ldap/lib/Group_LDAP.php @@ -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); |