From 666ec012eedd4e0da96368118e88189bf79bc706 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Thu, 19 May 2022 15:41:32 +0200 Subject: [PATCH] perform exact Ldap search as well to make sure it works for attributes without a substr matching rule Signed-off-by: Julien Veyssier --- apps/user_ldap/lib/Access.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index 29d60817c02eb..9fdfb440d0339 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -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; } }