perform exact Ldap search as well to make sure it works for attributes without a substr matching rule

Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
pull/32499/head
Julien Veyssier 2022-05-19 15:41:32 +07:00 committed by Arthur Schiwon (Rebase PR Action)
parent eecd4601ac
commit f3cd559c54
1 changed files with 5 additions and 0 deletions

@ -1537,14 +1537,19 @@ class Access extends LDAPUtility {
}
}
$originalSearch = $search;
$search = $this->prepareSearchTerm($search);
if (!is_array($searchAttributes) || count($searchAttributes) === 0) {
if ($fallbackAttribute === '') {
return '';
}
// wildcards don't work with some attributes
$filter[] = $fallbackAttribute . '=' . $originalSearch;
$filter[] = $fallbackAttribute . '=' . $search;
} else {
foreach ($searchAttributes as $attribute) {
// wildcards don't work with some attributes
$filter[] = $attribute . '=' . $originalSearch;
$filter[] = $attribute . '=' . $search;
}
}