diff --git a/core/src/plugins/core.conf/class.AbstractConfDriver.php b/core/src/plugins/core.conf/class.AbstractConfDriver.php index 2fe6095016..3e0cd2ea37 100644 --- a/core/src/plugins/core.conf/class.AbstractConfDriver.php +++ b/core/src/plugins/core.conf/class.AbstractConfDriver.php @@ -1101,8 +1101,12 @@ public function switchAction($action, $httpVars, $fileVars) $crtValue = $httpVars["value"]; $usersOnly = isSet($httpVars["users_only"]) && $httpVars["users_only"] == "true"; $existingOnly = isSet($httpVars["existing_only"]) && $httpVars["existing_only"] == "true"; - if(!empty($crtValue)) $regexp = '^'.$crtValue; - else $regexp = null; + if(!empty($crtValue)) { + $regexp = '^'.$crtValue; + $pregexp = '/^'.preg_quote($crtValue).'/i'; + } else { + $regexp = $pregexp = null; + } $skipDisplayWithoutRegexp = ConfService::getCoreConf("USERS_LIST_REGEXP_MANDATORY", "conf"); if($skipDisplayWithoutRegexp && $regexp == null){ $users = ""; @@ -1193,13 +1197,13 @@ public function switchAction($action, $httpVars, $fileVars) $users .= "
  • $crtValue
  • "; } $mess = ConfService::getMessages(); - if ($regexp == null && !$usersOnly) { + if (!$usersOnly && (empty($regexp) || preg_match($pregexp, $mess["447"]))) { $users .= "
  • ".$mess["447"]."
  • "; } $indexGroup = 0; if (!$usersOnly && isset($allGroups) && is_array($allGroups)) { foreach ($allGroups as $groupId => $groupLabel) { - if ($regexp == null || preg_match("/$regexp/i", $groupLabel)) { + if ($regexp == null || preg_match($pregexp, $groupLabel)) { $users .= "
  • ".$groupLabel."
  • "; $indexGroup++; } @@ -1209,7 +1213,9 @@ public function switchAction($action, $httpVars, $fileVars) if ($regexp == null && method_exists($this, "listUserTeams") && !$usersOnly) { $teams = $this->listUserTeams(); foreach ($teams as $tId => $tData) { - $users.= "
  • [team] ".$tData["LABEL"]."
  • "; + if($regexp == null || preg_match($pregexp, $tData["LABEL"])){ + $users.= "
  • [team] ".$tData["LABEL"]."
  • "; + } } } foreach ($allUsers as $userId => $userObject) { diff --git a/core/src/plugins/core.conf/standard_conf_actions.xml b/core/src/plugins/core.conf/standard_conf_actions.xml index e2bb3a9b8a..43d65d0beb 100644 --- a/core/src/plugins/core.conf/standard_conf_actions.xml +++ b/core/src/plugins/core.conf/standard_conf_actions.xml @@ -473,6 +473,9 @@ window.ajxpBootstrap.parameters.set("currentLanguage", value); } ]]> +