From dc9e8308872282073eef8611d2d0fbad846c2001 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Tue, 19 Jul 2011 13:30:39 +0000 Subject: [PATCH] 2011-07-19 Sergio Martin * include/functions_html.php: Fixed check when no agents for bug 3371316 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4586 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_html.php | 17 +++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) 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'])) {