From 346ed803440b4108cd3b04d562e4c51bbd185e1e Mon Sep 17 00:00:00 2001 From: darode Date: Tue, 13 Jul 2010 09:31:30 +0000 Subject: [PATCH] =?UTF-8?q?2010-07-13=20=20Dar=C3=ADo=20Rodr=C3=ADguez=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * godmode/reporting/graph_builder.php: Fixed problem when creating or updating a graph with empty name. Fixes: #3026943 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2999 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ .../godmode/reporting/graph_builder.php | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f10faf8a51..85917f8a54 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2010-07-13 Darío Rodríguez + + * godmode/reporting/graph_builder.php: Fixed problem when creating or + updating a graph with empty name. + Fixes: #3026943 + 2010-07-13 Sergio Martin * include/functions_visual_map.php diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php index ec0000f376..9cc3cc4bf5 100644 --- a/pandora_console/godmode/reporting/graph_builder.php +++ b/pandora_console/godmode/reporting/graph_builder.php @@ -81,9 +81,13 @@ if ($add_graph) { 'period' => $period, 'width' => $width, 'height' => $height, 'private' => 0, 'id_group' => $idGroup, 'events' => $events, 'stacked' => $stacked); - - $id_graph = process_sql_insert('tgraph', $values); - + + if (trim($name) != "") { + $id_graph = process_sql_insert('tgraph', $values); + } else { + $id_graph = false; + } + if(!$id_graph) $edit_graph = false; } @@ -100,9 +104,14 @@ if ($update_graph) { $events = get_parameter('events'); $alerts = get_parameter('alerts'); + if (trim($name) != "") { + $success = process_sql_update('tgraph', array('name' => $name, 'id_group' => $id_group, 'description' => $description, 'width' => $width, 'height' => $height, 'period' => $period, 'stacked' => $stacked, 'events' => $events), array('id_graph' => $id)); + } else { + $success = false; + } } function add_quotes($item)