diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index 9fe0aa6426856..d51d55bc0e646 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -1580,7 +1580,12 @@ private function prepareSearchTerm(string $term): string { if ($term === '') { $result = '*'; } elseif ($allowEnum !== 'no') { - $result = $term . '*'; + $activeDirectoryCompat = $this->appConfig->getValueBool('user_ldap', 'partial_search_active_directory_compatibility', false); + if ($activeDirectoryCompat) { + $result = '*' . $term . '*'; + } else { + $result = $term . '*'; + } } return $result; }