From c5a34970b762cce31aa055776b017204c53b440a Mon Sep 17 00:00:00 2001 From: darode Date: Fri, 29 Jul 2011 13:56:02 +0000 Subject: [PATCH] 2011-07-29 Dario Rodriguez * godmode/groups/group_list.php: Fixed a bug that allow to delete all agent groups and makes pandora unstable. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4654 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/godmode/groups/group_list.php | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5071164cba..1ad474ddc0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-07-29 Dario Rodriguez + + * godmode/groups/group_list.php: Fixed a bug that allow + to delete all agent groups and makes pandora unstable. + 2011-07-29 Dario Rodriguez * godmode/modules/manage_network_templates_form.php: Fixed diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index d287cd40f5..adaa19f67c 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -302,8 +302,12 @@ if(!empty($groups)) { $data[4] = ''; } else { + $data[4] = '' . html_print_image("images/config.png", true, array("alt" => __('Edit'), "title" => __('Edit'), "border" => '0')); - $data[4] .= '  ' . html_print_image("images/cross.png", true, array("alt" => __('Delete'), "border" => '0')); + //Check if there is only a group to unable delete it + if ((count($groups) > 3) || (count($groups) <= 3 && $group['parent'] != 0)) { + $data[4] .= '  ' . html_print_image("images/cross.png", true, array("alt" => __('Delete'), "border" => '0')); + } } array_push ($table->data, $data);