diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 65cdfe22d7..6c89d78765 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2013-11-04 Sergio Martin + + * include/functions_groups.php: Fixed function that + returns the user groups in tree way. It was broken + when the user has acls over a group but not in his + father. Incident: #342 + Merged from 4.1 + 2013-10-31 Hirofumi Kosaka * include/functions_api.php: Added some parameters to diff --git a/pandora_console/include/functions_groups.php b/pandora_console/include/functions_groups.php index d75b9eff5c..9a935fcb0e 100644 --- a/pandora_console/include/functions_groups.php +++ b/pandora_console/include/functions_groups.php @@ -494,6 +494,13 @@ function groups_get_groups_tree_recursive($groups, $trash = 0, $trash2 = 0) { if ($group['id_grupo'] == 0) { continue; } + + // If the user has ACLs on a gruop but not in his father, + // we consider it as a son of group "all" + if(!in_array($group['parent'], array_keys($groups))) { + $group['parent'] = 0; + } + $tree[$group['parent']]['hash_branch'] = 1; $tree[$group['parent']]['branch'][$key] = &$tree[$key];