diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f9b7f702f9..4761c06019 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-07-19 Sergio Martin + + * include/functions_html.php: Fixed check when no + agents for bug 3371316 + 2011-07-19 Sergio Martin * include/functions_graph.php diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 3beb140352..9e7e5c1242 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -193,12 +193,17 @@ function html_print_select_groups($id_user = false, $privilege = "AR", $returnAl unset($user_groups[$id_group]); } - // First group it's needed to retrieve its parent group - $first_group = array_slice($user_groups, 0, 1); - $parent_group = $first_group[0]['parent']; - - $user_groups_tree = groups_get_groups_tree_recursive($user_groups, $parent_group); - + if(empty($user_groups)) { + $user_groups_tree = array(); + } + else { + // First group it's needed to retrieve its parent group + $first_group = array_slice($user_groups, 0, 1); + $parent_group = $first_group[0]['parent']; + + $user_groups_tree = groups_get_groups_tree_recursive($user_groups, $parent_group); + } + $fields = array(); foreach ($user_groups_tree as $group) { if (isset($config['text_char_long'])) {