diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index 7f395f03bf308..e2cba8b980cf6 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -1572,7 +1572,12 @@ private function prepareSearchTerm(string $term): string { if ($term === '') { $result = '*'; } elseif ($allowEnum) { - $result = $term . '*'; + $usePrefixWildcard = $this->appConfig->getValueBool('user_ldap', 'partial_search_with_prefix_wildcard', false); + if ($usePrefixWildcard) { + $result = '*' . $term . '*'; + } else { + $result = $term . '*'; + } } return $result; }