From c19987d5d6b03a371b09cfc4d61ab88f32656e64 Mon Sep 17 00:00:00 2001 From: vgilc Date: Mon, 9 Jan 2012 10:04:31 +0000 Subject: [PATCH] 2012-01-09 Vanessa Gil * godmode/netflow/nf_item_list.php godmode/netflow/nf_report_item.php pandoradb.sql: Fixed editing and deleting netflow filters. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5328 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ .../godmode/netflow/nf_item_list.php | 6 +++--- .../godmode/netflow/nf_report_item.php | 6 ++++-- pandora_console/pandoradb.sql | 19 ++++--------------- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 2de4bcc74c..f8d918f029 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-01-09 Vanessa Gil + * godmode/netflow/nf_item_list.php + godmode/netflow/nf_report_item.php + pandoradb.sql: Fixed editing and deleting netflow filters. + 2012-01-05 Ramon Novoa * include/functions_graph.php, diff --git a/pandora_console/godmode/netflow/nf_item_list.php b/pandora_console/godmode/netflow/nf_item_list.php index 616bcf124a..19e696516c 100644 --- a/pandora_console/godmode/netflow/nf_item_list.php +++ b/pandora_console/godmode/netflow/nf_item_list.php @@ -134,8 +134,9 @@ $total_reports_item = $total_reports_item[0]['total']; $data = array (); $data[0] = ''.$item['id_rc'].''; - - $data[1] = $item['id_filter']; + $name_filter = db_get_value('id_name', 'tnetflow_filter', 'id_sg', $item['id_filter']); + //$data[1] = $item['id_filter']; + $data[1] = $name_filter; $data[2] = $item['max']; @@ -153,7 +154,6 @@ $total_reports_item = $total_reports_item[0]['total']; $data[3] = 'Table total period'; break; } - //$data[3] = $item['show_graph']; $data[4] = "" . diff --git a/pandora_console/godmode/netflow/nf_report_item.php b/pandora_console/godmode/netflow/nf_report_item.php index 223916a3b9..5da1a43cd6 100644 --- a/pandora_console/godmode/netflow/nf_report_item.php +++ b/pandora_console/godmode/netflow/nf_report_item.php @@ -60,13 +60,14 @@ if ($id_rc) { if ($update) { $name_filter = get_parameter('id_filter'); + $id_filter = db_get_value('id_sg', 'tnetflow_filter', 'id_name', $name_filter); $max_val = get_parameter('max','2'); $show_graph = get_parameter('show_graph',''); $result = db_process_sql_update ('tnetflow_report_content', array ( 'id_report' => $id, - 'id_filter' => $name_filter, + 'id_filter' => $id_filter, 'max' => $max_val, 'show_graph' => $show_graph ), @@ -79,12 +80,13 @@ if ($update) { if ($create){ $name_filter = get_parameter('id_filter'); + $id_filter = db_get_value('id_sg', 'tnetflow_filter', 'id_name', $name_filter); $max_val = get_parameter('max','2'); $show_graph = get_parameter('show_graph',''); $values = array ( 'id_report' => $id, - 'id_filter' => $name_filter, + 'id_filter' => $id_filter, 'max' => $max_val, 'show_graph' => $show_graph ); diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 96e79fe3a1..28753f66d8 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1312,19 +1312,6 @@ CREATE TABLE IF NOT EXISTS `tnetflow_report` ( PRIMARY KEY(`id_report`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- ----------------------------------------------------- --- Table `tnetflow_options` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `tnetflow_options` ( - `id_option` int(10) unsigned NOT NULL auto_increment, - `id_name` varchar(60) NOT NULL default '0', - `description` TEXT NOT NULL default '', - `path` varchar(200), - `port` varchar(100), -PRIMARY KEY (`id_option`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -- ----------------------------------------------------- -- Table `tnetflow_report_content` -- ----------------------------------------------------- @@ -1332,12 +1319,14 @@ PRIMARY KEY (`id_option`) CREATE TABLE IF NOT EXISTS `tnetflow_report_content` ( `id_rc` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, `id_report` INTEGER UNSIGNED NOT NULL default 0, - `id_filter` varchar(60), + `id_filter` INTEGER UNSIGNED NOT NULL default 0, `date` bigint(20) NOT NULL default '0', `period` int(11) NOT NULL default 0, `max` int (11) NOT NULL default 0, `show_graph` varchar(60), PRIMARY KEY(`id_rc`), FOREIGN KEY (`id_report`) REFERENCES tnetflow_report(`id_report`) - ON UPDATE CASCADE ON DELETE CASCADE + ON DELETE CASCADE, + FOREIGN KEY (`id_filter`) REFERENCES tnetflow_filter(`id_sg`) + ON DELETE CASCADE ) ENGINE = InnoDB DEFAULT CHARSET=utf8;