From e09a7873d1f5119fb76f0414075cdc68972184ff Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 10 Feb 2026 13:26:47 +0100 Subject: [PATCH 1/2] feat(user_ldap): Add config for partial search compatibility with ActiveDirectory Signed-off-by: Marcel Klehr --- apps/user_ldap/lib/Access.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index a6a414d29bf93..72d13f0cabe36 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -1576,7 +1576,12 @@ private function prepareSearchTerm(string $term): string { if ($term === '') { $result = '*'; } elseif ($allowEnum) { - $result = $term . '*'; + $activeDirectoryCompat = $this->appConfig->getValueBool('user_ldap', 'partial_search_active_directory_compatibility', false); + if ($activeDirectoryCompat) { + $result = '*' . $term . '*'; + } else { + $result = $term . '*'; + } } return $result; } From 120f9a34f52ac1d9a0ee9339489e86d0b7f41fe6 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 19 Mar 2026 16:17:31 +0100 Subject: [PATCH 2/2] fix: Change the setting name Signed-off-by: Marcel Klehr --- apps/user_ldap/lib/Access.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index 72d13f0cabe36..aff33fcb23b4b 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -1576,8 +1576,8 @@ private function prepareSearchTerm(string $term): string { if ($term === '') { $result = '*'; } elseif ($allowEnum) { - $activeDirectoryCompat = $this->appConfig->getValueBool('user_ldap', 'partial_search_active_directory_compatibility', false); - if ($activeDirectoryCompat) { + $usePrefixWildcard = $this->appConfig->getValueBool('user_ldap', 'partial_search_with_prefix_wildcard', false); + if ($usePrefixWildcard) { $result = '*' . $term . '*'; } else { $result = $term . '*';