diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-07-27 08:38:45 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-07-27 08:38:45 +0200 |
commit | 933f087d2198917c3cd1de4b6dc6dce691fc3a07 (patch) | |
tree | 85f3a93ca9d351450530b80b699f6c3c24e2e4ed /apps/user_ldap/lib/access.php | |
parent | bacada263cac90302578925ecca0d85196f3fabb (diff) | |
parent | bfdf39b9bd286e7739937f8856f85787e987043a (diff) | |
download | nextcloud-server-933f087d2198917c3cd1de4b6dc6dce691fc3a07.tar.gz nextcloud-server-933f087d2198917c3cd1de4b6dc6dce691fc3a07.zip |
Merge pull request #17526 from owncloud/fix-17516
LDAP: when checking group for matching filter, also take base DN into…
Diffstat (limited to 'apps/user_ldap/lib/access.php')
-rw-r--r-- | apps/user_ldap/lib/access.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 89d966772ee..a2eb834b496 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -365,10 +365,21 @@ class Access extends LDAPUtility implements user\IUserTools { continue; } + // Check the base DN first. If this is not met already, we don't + // need to ask the server at all. + if(!$this->isDNPartOfBase($dn, $this->connection->ldapBaseGroups)) { + $this->connection->writeToCache($cacheKey, false); + continue; + } + $result = $this->readAttribute($dn, 'cn', $this->connection->ldapGroupFilter); if(is_array($result)) { + $this->connection->writeToCache($cacheKey, true); $validGroupDNs[] = $dn; + } else { + $this->connection->writeToCache($cacheKey, false); } + } return $validGroupDNs; } |