Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 94a5e24

Browse files
committed
Fix Team and Group listing and filtering by keeping an alt. pregexp value.
1 parent 90766f3 commit 94a5e24

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

core/src/plugins/core.conf/class.AbstractConfDriver.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,8 +1101,12 @@ public function switchAction($action, $httpVars, $fileVars)
11011101
$crtValue = $httpVars["value"];
11021102
$usersOnly = isSet($httpVars["users_only"]) && $httpVars["users_only"] == "true";
11031103
$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+
}
11061110
$skipDisplayWithoutRegexp = ConfService::getCoreConf("USERS_LIST_REGEXP_MANDATORY", "conf");
11071111
if($skipDisplayWithoutRegexp && $regexp == null){
11081112
$users = "";
@@ -1193,13 +1197,13 @@ public function switchAction($action, $httpVars, $fileVars)
11931197
$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>";
11941198
}
11951199
$mess = ConfService::getMessages();
1196-
if ($regexp == null && !$usersOnly) {
1200+
if (!$usersOnly && (empty($regexp) || preg_match($pregexp, $mess["447"]))) {
11971201
$users .= "<li class='complete_group_entry' data-group='AJXP_GRP_/' data-label=\"".$mess["447"]."\"><span class='user_entry_label'>".$mess["447"]."</span></li>";
11981202
}
11991203
$indexGroup = 0;
12001204
if (!$usersOnly && isset($allGroups) && is_array($allGroups)) {
12011205
foreach ($allGroups as $groupId => $groupLabel) {
1202-
if ($regexp == null || preg_match("/$regexp/i", $groupLabel)) {
1206+
if ($regexp == null || preg_match($pregexp, $groupLabel)) {
12031207
$users .= "<li class='complete_group_entry' data-group='$groupId' data-label=\"$groupLabel\" data-entry_id='$groupId'><span class='user_entry_label'>".$groupLabel."</span></li>";
12041208
$indexGroup++;
12051209
}
@@ -1209,7 +1213,9 @@ public function switchAction($action, $httpVars, $fileVars)
12091213
if ($regexp == null && method_exists($this, "listUserTeams") && !$usersOnly) {
12101214
$teams = $this->listUserTeams();
12111215
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+
}
12131219
}
12141220
}
12151221
foreach ($allUsers as $userId => $userObject) {

core/src/plugins/core.conf/standard_conf_actions.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,9 @@
473473
window.ajxpBootstrap.parameters.set("currentLanguage", value);
474474
}
475475
]]></dialogOnComplete>
476+
<dialogOnCancel><![CDATA[
477+
pydio.Controller.fireAction("login");
478+
]]></dialogOnCancel>
476479
<dialogOnCancel><![CDATA[]]></dialogOnCancel>
477480
</clientCallback>
478481
<clientForm id="switch_language_form"><![CDATA[

0 commit comments

Comments
 (0)