Skip to content

Commit f3cd559

Browse files
Julien Veyssierblizzz
authored andcommitted
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>
1 parent eecd460 commit f3cd559

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

apps/user_ldap/lib/Access.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,14 +1537,19 @@ private function getFilterPartForSearch(string $search, $searchAttributes, strin
15371537
}
15381538
}
15391539

1540+
$originalSearch = $search;
15401541
$search = $this->prepareSearchTerm($search);
15411542
if (!is_array($searchAttributes) || count($searchAttributes) === 0) {
15421543
if ($fallbackAttribute === '') {
15431544
return '';
15441545
}
1546+
// wildcards don't work with some attributes
1547+
$filter[] = $fallbackAttribute . '=' . $originalSearch;
15451548
$filter[] = $fallbackAttribute . '=' . $search;
15461549
} else {
15471550
foreach ($searchAttributes as $attribute) {
1551+
// wildcards don't work with some attributes
1552+
$filter[] = $attribute . '=' . $originalSearch;
15481553
$filter[] = $attribute . '=' . $search;
15491554
}
15501555
}

0 commit comments

Comments
 (0)