From 58213e1355af46221bad52abecf063c8ddf7fb5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Gomes=20da=20Silva=20Lisboa?= Date: Thu, 14 Dec 2017 08:24:21 -0200 Subject: [PATCH] User is not found when is searched by name and one of surnames #7510 --- 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 27fda38a7373f..0cd649f6882d3 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -1460,12 +1460,17 @@ private function prepareSearchTerm($term) { $config = \OC::$server->getConfig(); $allowEnum = $config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes'); + $allowMedialSearches = $config->getSystemValue('user_ldap.enable_medial_search', false); $result = $term; if ($term === '') { $result = '*'; } else if ($allowEnum !== 'no') { - $result = $term . '*'; + if ($allowMedialSearches) { + $result = '*' . $term . '*'; + } else { + $result = $term . '*'; + } } return $result; }