summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib
diff options
context:
space:
mode:
authorRoland Tapken <roland@bitarbeiter.net>2018-03-07 12:18:46 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2018-06-12 18:21:22 +0200
commited7870327571c3a840051a972a84ecdc262db728 (patch)
tree2359ab2f42fde17d929eae5bca12310cd9842d4c /apps/user_ldap/lib
parent57a8fa1b2270c7916c19cb1cf748888aa9a9c7d6 (diff)
downloadnextcloud-server-ed7870327571c3a840051a972a84ecdc262db728.tar.gz
nextcloud-server-ed7870327571c3a840051a972a84ecdc262db728.zip
dn2ocname: also apply group filter to readAttribute()
Signed-off-by: Roland Tapken <roland@bitarbeiter.net>
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r--apps/user_ldap/lib/Access.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index fe286f88a83..f0740f8921f 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -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,13 +567,9 @@ class Access extends LDAPUtility implements IUserTools {
}
if(is_null($ldapName)) {
- if ($isUser) {
- $ldapName = $this->readAttribute($fdn, $nameAttribute, $this->connection->ldapUserFilter);
- } else {
- $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];