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

Commit

Permalink
Fix #268, there was a double "basegroup filtering".
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Aug 20, 2013
1 parent 4d12eb1 commit 8bef2fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Expand Up @@ -413,13 +413,14 @@ function switchAction($action, $httpVars, $fileVars){
$roleId = SystemTextEncoding::magicDequote($httpVars["role_id"]);
$roleGroup = false;
if(strpos($roleId, "AJXP_GRP_") === 0){
$groupPath = AuthService::filterBaseGroup(substr($roleId, strlen("AJXP_GRP_/")));
$groupPath = substr($roleId, strlen("AJXP_GRP_"));
$filteredGroupPath = AuthService::filterBaseGroup($groupPath);
$groups = AuthService::listChildrenGroups(AJXP_Utils::forwardSlashDirname($groupPath));
$key = "/".basename($groupPath);
if(!array_key_exists($key, $groups)){
throw new Exception("Cannot find group with this id!");
}
$roleId = "AJXP_GRP_".$groupPath;
$roleId = "AJXP_GRP_".$filteredGroupPath;
$groupLabel = $groups[$key];
$roleGroup = true;
}
Expand Down Expand Up @@ -483,8 +484,9 @@ function switchAction($action, $httpVars, $fileVars){
$roleId = SystemTextEncoding::magicDequote($httpVars["role_id"]);
$roleGroup = false;
if(strpos($roleId, "AJXP_GRP_") === 0){
$groupPath = AuthService::filterBaseGroup(substr($roleId, strlen("AJXP_GRP_")));
$roleId = "AJXP_GRP_".$groupPath;
$groupPath = substr($roleId, strlen("AJXP_GRP_"));
$filteredGroupPath = AuthService::filterBaseGroup($groupPath);
$roleId = "AJXP_GRP_".$filteredGroupPath;
$groups = AuthService::listChildrenGroups(AJXP_Utils::forwardSlashDirname($groupPath));
$key = "/".basename($groupPath);
if(!array_key_exists($key, $groups)){
Expand Down Expand Up @@ -531,7 +533,7 @@ function switchAction($action, $httpVars, $fileVars){
$userObject->setProfile($data["USER"]["PROFILE"]);
}
if(isSet($data["GROUP_LABEL"]) && isSet($groupLabel) && $groupLabel != $data["GROUP_LABEL"]){
ConfService::getConfStorageImpl()->relabelGroup($groupPath, $data["GROUP_LABEL"]);
ConfService::getConfStorageImpl()->relabelGroup($filteredGroupPath, $data["GROUP_LABEL"]);
}

$output = array();
Expand Down
2 changes: 2 additions & 0 deletions core/src/plugins/editor.ajxp_role/class.RoleEditor.js
Expand Up @@ -406,6 +406,8 @@ Class.create("RoleEditor", AbstractEditor, {
];
defs = $A(defs);
f.createParametersInputs(this.element.down("#pane-infos").down("#account_infos"), defs, true, false, false, true);
// UPDATE MAIN HEADER
this.element.down("span.header_label").update(this.roleData.GROUP.LABEL);

// REMOVE BUTTONS
this.element.down("#pane-infos").down("#account_actions").remove();
Expand Down

0 comments on commit 8bef2fd

Please sign in to comment.