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

Commit

Permalink
Fix list by label or role (cut off prefix)
Browse files Browse the repository at this point in the history
  • Loading branch information
c12simple committed Nov 25, 2014
1 parent f8d4131 commit 34f63bb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/src/plugins/core.conf/class.AbstractConfDriver.php
Expand Up @@ -1141,11 +1141,14 @@ public function switchAction($action, $httpVars, $fileVars)
if ($regexp == null && !$usersOnly) {
$users .= "<li class='complete_group_entry' data-group='AJXP_GRP_/' data-label='".$mess["447"]."'><span class='user_entry_label'>".$mess["447"]."</span></li>";
}
$indexGroup = 0;
if (!$usersOnly && is_array($allGroups)) {
foreach ($allGroups as $groupId => $groupLabel) {
if ($regexp == null || preg_match("/$regexp/i", $groupLabel)) {
$users .= "<li class='complete_group_entry' data-group='$groupId' data-label='$groupLabel' data-entry_id='$groupId'><span class='user_entry_label'>".$groupLabel."</span></li>";
$indexGroup++;
}
if($indexGroup == $limit) break;
}
}
if ($regexp == null && method_exists($this, "listUserTeams")) {
Expand Down Expand Up @@ -1304,9 +1307,8 @@ public function getUserRoleList($userObject, $rolePrefix, $includeString, $exclu
if (isSet($valueFiltersInclude) && !in_array(strtolower(substr($roleId, strlen($rolePrefix))), $valueFiltersInclude)) continue;
$roleObject = AuthService::getRole($roleId);
$label = $roleObject->getLabel();
$label = !empty($label) ? $label : $roleId;

$allRoles[$roleId] = substr($label, strlen($rolePrefix));
$label = !empty($label) ? $label : substr($roleId, strlen($rolePrefix));
$allRoles[$roleId] = $label;
}
}
return $allRoles;
Expand Down

0 comments on commit 34f63bb

Please sign in to comment.