@@ -1101,8 +1101,12 @@ public function switchAction($action, $httpVars, $fileVars)
1101
1101
$ crtValue = $ httpVars ["value " ];
1102
1102
$ usersOnly = isSet ($ httpVars ["users_only " ]) && $ httpVars ["users_only " ] == "true " ;
1103
1103
$ existingOnly = isSet ($ httpVars ["existing_only " ]) && $ httpVars ["existing_only " ] == "true " ;
1104
- if (!empty ($ crtValue )) $ regexp = '^ ' .$ crtValue ;
1105
- else $ regexp = null ;
1104
+ if (!empty ($ crtValue )) {
1105
+ $ regexp = '^ ' .$ crtValue ;
1106
+ $ pregexp = '/^ ' .preg_quote ($ crtValue ).'/i ' ;
1107
+ } else {
1108
+ $ regexp = $ pregexp = null ;
1109
+ }
1106
1110
$ skipDisplayWithoutRegexp = ConfService::getCoreConf ("USERS_LIST_REGEXP_MANDATORY " , "conf " );
1107
1111
if ($ skipDisplayWithoutRegexp && $ regexp == null ){
1108
1112
$ users = "" ;
@@ -1193,13 +1197,13 @@ public function switchAction($action, $httpVars, $fileVars)
1193
1197
$ users .= "<li class='complete_user_entry_temp' data-temporary='true' data-label=' $ crtValue' data-entry_id=' $ crtValue'><span class='user_entry_label'> $ crtValue</span></li> " ;
1194
1198
}
1195
1199
$ mess = ConfService::getMessages ();
1196
- if ($ regexp == null && ! $ usersOnly ) {
1200
+ if (! $ usersOnly && ( empty ( $ regexp) || preg_match ( $ pregexp , $ mess [ " 447 " ])) ) {
1197
1201
$ users .= "<li class='complete_group_entry' data-group='AJXP_GRP_/' data-label= \"" .$ mess ["447 " ]."\"><span class='user_entry_label'> " .$ mess ["447 " ]."</span></li> " ;
1198
1202
}
1199
1203
$ indexGroup = 0 ;
1200
1204
if (!$ usersOnly && isset ($ allGroups ) && is_array ($ allGroups )) {
1201
1205
foreach ($ allGroups as $ groupId => $ groupLabel ) {
1202
- if ($ regexp == null || preg_match (" / $ regexp /i " , $ groupLabel )) {
1206
+ if ($ regexp == null || preg_match ($ pregexp , $ groupLabel )) {
1203
1207
$ users .= "<li class='complete_group_entry' data-group=' $ groupId' data-label= \"$ groupLabel \" data-entry_id=' $ groupId'><span class='user_entry_label'> " .$ groupLabel ."</span></li> " ;
1204
1208
$ indexGroup ++;
1205
1209
}
@@ -1209,7 +1213,9 @@ public function switchAction($action, $httpVars, $fileVars)
1209
1213
if ($ regexp == null && method_exists ($ this , "listUserTeams " ) && !$ usersOnly ) {
1210
1214
$ teams = $ this ->listUserTeams ();
1211
1215
foreach ($ teams as $ tId => $ tData ) {
1212
- $ users .= "<li class='complete_group_entry' data-group='/AJXP_TEAM/ $ tId' data-label= \"[team] " .$ tData ["LABEL " ]."\"><span class='user_entry_label'>[team] " .$ tData ["LABEL " ]."</span></li> " ;
1216
+ if ($ regexp == null || preg_match ($ pregexp , $ tData ["LABEL " ])){
1217
+ $ users .= "<li class='complete_group_entry' data-group='/AJXP_TEAM/ $ tId' data-label= \"[team] " .$ tData ["LABEL " ]."\"><span class='user_entry_label'>[team] " .$ tData ["LABEL " ]."</span></li> " ;
1218
+ }
1213
1219
}
1214
1220
}
1215
1221
foreach ($ allUsers as $ userId => $ userObject ) {
0 commit comments