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

Commit

Permalink
Performances: do not call getRole() again if role is already loaded i…
Browse files Browse the repository at this point in the history
…n the loop
  • Loading branch information
cdujeu committed Feb 16, 2015
1 parent 5a32597 commit c4f6e3c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/plugins/core.conf/class.AbstractConfDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,8 @@ public function getUserRoleList($userObject, $rolePrefix, $includeString, $exclu
if (isSet($valueFiltersExclude) && in_array(strtolower(substr($roleId, strlen($rolePrefix))), $valueFiltersExclude)) continue;
if (isSet($matchFilterInclude) && !preg_match($matchFilterInclude, substr($roleId, strlen($rolePrefix)))) continue;
if (isSet($valueFiltersInclude) && !in_array(strtolower(substr($roleId, strlen($rolePrefix))), $valueFiltersInclude)) continue;
$roleObject = AuthService::getRole($roleId);
if(is_a($role, "AJXP_Role")) $roleObject = $role;
else $roleObject = AuthService::getRole($roleId);
$label = $roleObject->getLabel();
$label = !empty($label) ? $label : substr($roleId, strlen($rolePrefix));
$allRoles[$roleId] = $label;
Expand Down

0 comments on commit c4f6e3c

Please sign in to comment.