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 4 years ago committed by Arthur Schiwon (Rebase PR Action)
parent eecd4601ac
commit f3cd559c54
  1. 5
      apps/user_ldap/lib/Access.php

@ -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;
}
}

Loading…
Cancel
Save