dn2ocname: also apply group filter to readAttribute()
Signed-off-by: Roland Tapken <roland@bitarbeiter.net>
This commit is contained in:
parent
57a8fa1b22
commit
ed78703275
|
@ -539,9 +539,11 @@ class Access extends LDAPUtility implements IUserTools {
|
||||||
if($isUser) {
|
if($isUser) {
|
||||||
$mapper = $this->getUserMapper();
|
$mapper = $this->getUserMapper();
|
||||||
$nameAttribute = $this->connection->ldapUserDisplayName;
|
$nameAttribute = $this->connection->ldapUserDisplayName;
|
||||||
|
$filter = $this->connection->ldapUserFilter;
|
||||||
} else {
|
} else {
|
||||||
$mapper = $this->getGroupMapper();
|
$mapper = $this->getGroupMapper();
|
||||||
$nameAttribute = $this->connection->ldapGroupDisplayName;
|
$nameAttribute = $this->connection->ldapGroupDisplayName;
|
||||||
|
$filter = $this->connection->ldapGroupFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//let's try to retrieve the Nextcloud name from the mappings table
|
//let's try to retrieve the Nextcloud name from the mappings table
|
||||||
|
@ -565,13 +567,9 @@ class Access extends LDAPUtility implements IUserTools {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_null($ldapName)) {
|
if(is_null($ldapName)) {
|
||||||
if ($isUser) {
|
$ldapName = $this->readAttribute($fdn, $nameAttribute, $filter);
|
||||||
$ldapName = $this->readAttribute($fdn, $nameAttribute, $this->connection->ldapUserFilter);
|
|
||||||
} else {
|
|
||||||
$ldapName = $this->readAttribute($fdn, $nameAttribute);
|
|
||||||
}
|
|
||||||
if(!isset($ldapName[0]) && empty($ldapName[0])) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
$ldapName = $ldapName[0];
|
$ldapName = $ldapName[0];
|
||||||
|
|
Loading…
Reference in New Issue