Merge pull request #9839 from nextcloud/backport/8221/stable13

[stable13] Apply ldapUserFilter on members of group
This commit is contained in:
John Molakvoæ 2018-06-13 06:55:41 +02:00 committed by GitHub
commit 0d9c33838b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -539,9 +539,11 @@ class Access extends LDAPUtility implements IUserTools {
if($isUser) {
$mapper = $this->getUserMapper();
$nameAttribute = $this->connection->ldapUserDisplayName;
$filter = $this->connection->ldapUserFilter;
} else {
$mapper = $this->getGroupMapper();
$nameAttribute = $this->connection->ldapGroupDisplayName;
$filter = $this->connection->ldapGroupFilter;
}
//let's try to retrieve the Nextcloud name from the mappings table
@ -565,9 +567,9 @@ class Access extends LDAPUtility implements IUserTools {
}
if(is_null($ldapName)) {
$ldapName = $this->readAttribute($fdn, $nameAttribute);
$ldapName = $this->readAttribute($fdn, $nameAttribute, $filter);
if(!isset($ldapName[0]) && empty($ldapName[0])) {
\OCP\Util::writeLog('user_ldap', 'No or empty name for '.$fdn.'.', \OCP\Util::INFO);
\OCP\Util::writeLog('user_ldap', 'No or empty name for '.$fdn.' with filter '.$filter.'.', \OCP\Util::INFO);
return false;
}
$ldapName = $ldapName[0];