diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 473445af0e..7512e8028a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2013-06-17 Miguel de Dios + + * operation/agentes/networkmap.php: fixed to create networkmaps + with the same name (for example users with diferent groups ACL). + + Fixes: #2285 + + MERGED FROM THE BRANCH PANDORA_4.0 + 2013-06-17 Miguel de Dios * godmode/alerts/configure_alert_action.php, diff --git a/pandora_console/operation/agentes/networkmap.php b/pandora_console/operation/agentes/networkmap.php index 834b1d270c..80f7d0c83f 100644 --- a/pandora_console/operation/agentes/networkmap.php +++ b/pandora_console/operation/agentes/networkmap.php @@ -76,6 +76,7 @@ if ($add_networkmap) { $font_size, $group, $module_group, $depth, $modwithalerts, $hidepolicymodules, $zoom, $ranksep, $center, $text_filter, $dont_show_subgroups); + $message = ui_print_result_message ($id_networkmap, __('Network map created successfully'), __('Could not create network map'), '', true); @@ -85,6 +86,7 @@ if ($add_networkmap) { $layout, $nooverlap, $simple, $regen, $font_size, $group, $module_group, $depth, $modwithalerts, $hidepolicymodules, $zoom, $ranksep, $center, $text_filter, $dont_show_subgroups); + $message = ui_print_result_message ($id_networkmap, __('Network map created successfully'), __('Could not create network map'), '', true); @@ -110,38 +112,31 @@ if ($save_networkmap || $update_networkmap) { $module_group = (int) get_parameter ('module_group', 0); $center = (int) get_parameter ('center', 0); $name = (string) get_parameter ('name', $activeTab); - $check = db_get_value('name', 'tnetwork_map', 'name', $name); - $subcheck = db_get_value('name', 'tnetwork_map', 'id_networkmap', $id_networkmap); if ($save_networkmap) { - if (!$check || $subcheck == $name) { - $result = networkmap_update_networkmap($id_networkmap, - array('name' => $name, - 'type' => $activeTab, - 'layout' => $layout, - 'nooverlap' => $nooverlap, - 'simple' => $simple, - 'regenerate' => $regen, - 'font_size' => $font_size, - 'id_group' => $group, - 'id_module_group' => $module_group, - 'depth' => $depth, - 'only_modules_with_alerts' => $modwithalerts, - 'hide_policy_modules' => $hidepolicymodules, - 'zoom' => $zoom, - 'distance_nodes' => $ranksep, - 'text_filter' => $text_filter, - 'dont_show_subgroups' => $dont_show_subgroups, - 'center' => $center, - 'show_snmp_modules' => (int)$show_snmp_modules)); - - $message = ui_print_result_message ($result, - __('Network map saved successfully'), - __('Could not save network map'), '', true); - } - else { - $message = ui_print_error_message(__('Each network map must have a different name'),'',true); - } + $result = networkmap_update_networkmap($id_networkmap, + array('name' => $name, + 'type' => $activeTab, + 'layout' => $layout, + 'nooverlap' => $nooverlap, + 'simple' => $simple, + 'regenerate' => $regen, + 'font_size' => $font_size, + 'id_group' => $group, + 'id_module_group' => $module_group, + 'depth' => $depth, + 'only_modules_with_alerts' => $modwithalerts, + 'hide_policy_modules' => $hidepolicymodules, + 'zoom' => $zoom, + 'distance_nodes' => $ranksep, + 'text_filter' => $text_filter, + 'dont_show_subgroups' => $dont_show_subgroups, + 'center' => $center, + 'show_snmp_modules' => (int)$show_snmp_modules)); + + $message = ui_print_result_message ($result, + __('Network map saved successfully'), + __('Could not save network map'), '', true); } }