Skip to content

Commit

Permalink
perform exact Ldap search as well to make sure it works for attribute…
Browse files Browse the repository at this point in the history
…s without a substr matching rule

Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
  • Loading branch information
Julien Veyssier authored and blizzz committed Apr 13, 2023
1 parent eecd460 commit f3cd559
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/user_ldap/lib/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -1537,14 +1537,19 @@ private function getFilterPartForSearch(string $search, $searchAttributes, strin
}
}

$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;
}
}
Expand Down

0 comments on commit f3cd559

Please sign in to comment.