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 committed May 23, 2022
1 parent 384efc8 commit 666ec01
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 @@ -1533,14 +1533,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 666ec01

Please sign in to comment.