diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 103f2e0da3..0c92424b82 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2013-01-24 Miguel de Dios + + * include/functions_netflow.php, + operation/reporting/reporting_xml.php: fixed to show netflow data + in the XML report. + 2013-01-24 Miguel de Dios * pandoradb.postgreSQL.sql, pandoradb.oracle.sql, pandoradb.sql, @@ -8,22 +14,18 @@ * godmode/extensions.php, include/functions_tags.php, include/functions_ui.php, include/functions_agents.php, - include/functions_config.php, + include/functions_config.php: cleaned source code style. * godmode/reporting/visual_console_builder.editor.js, godmode/reporting/visual_console_builder.editor.php, include/styles/pandora.css, include/styles/pandora_legacy.css, include/functions_visual_map.php, include/ajax/visual_console_builder.ajax.php, - include/functions_visual_map_editor.php + include/functions_visual_map_editor.php: added the formatted label + into the item label with the help of tiny_mce. - * include/javascript/tiny_mce/*: - - - - - - + * include/javascript/tiny_mce/*: update the last version of + tiny_mce. 2013-01-23 Sergio Martin diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index 07d61b83f7..18430ab6b6 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -895,7 +895,7 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi $aggregate = $filter['aggregate']; $unit = $filter['output']; $interval = $end_date - $start_date; - + // Process item switch ($type) { case '0': @@ -978,6 +978,7 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi case '2': case 'netflow_data': $data = netflow_get_data ($start_date, $end_date, $interval_length, $filter, $aggregate, $max_aggregates, $unit, $connection_name); + if (empty ($data)) { break; } @@ -1106,29 +1107,41 @@ function netflow_xml_report ($id, $start_date, $end_date, $interval_length = 0) * */ function netflow_aggregate_area_xml ($data) { - - // Print source information - echo "\n"; - foreach ($data['sources'] as $source => $discard) { - echo "$source\n"; - } - echo "\n"; - // Print flow information - echo "\n"; - foreach ($data['data'] as $timestamp => $flow) { - - echo "\n"; - echo " " . $timestamp . "\n"; - echo " \n"; - foreach ($flow as $source => $data) { - echo " $source\n"; - echo " " . $data . "\n"; + // Print source information + if (isset($data['sources'])) { + echo "\n"; + foreach ($data['sources'] as $source => $discard) { + echo "$source\n"; } - echo " \n"; - echo "\n"; + echo "\n"; + + // Print flow information + echo "\n"; + foreach ($data['data'] as $timestamp => $flow) { + + echo "\n"; + echo " " . $timestamp . "\n"; + echo " \n"; + foreach ($flow as $source => $data) { + echo " $source\n"; + echo " " . $data . "\n"; + } + echo " \n"; + echo "\n"; + } + echo "\n"; + } + else { + echo "\n"; + foreach ($data as $timestamp => $flow) { + echo "\n"; + echo " " . $timestamp . "\n"; + echo " " . $flow['data'] . "\n"; + echo "\n"; + } + echo "\n"; } - echo "\n"; } /** diff --git a/pandora_console/operation/reporting/reporting_xml.php b/pandora_console/operation/reporting/reporting_xml.php index 5b975f085c..9df7647c4f 100644 --- a/pandora_console/operation/reporting/reporting_xml.php +++ b/pandora_console/operation/reporting/reporting_xml.php @@ -36,7 +36,7 @@ function xml_array ($array, $buffer_file = array()) { else { echo "<".$name.">"; } - + if (is_array ($value)) { //si es la ruta al fichero que contiene el xml if(is_string($file_to_print)) { @@ -57,7 +57,6 @@ function xml_array ($array, $buffer_file = array()) { } } - // Login check if (isset ($_GET["direct"])) { /* @@ -233,7 +232,8 @@ foreach ($contents as $content) { } } - $session_id = session_id(); + $session_id = session_id(); + switch ($content["type"]) { case 1: @@ -379,7 +379,7 @@ foreach ($contents as $content) { /// break; case 2: - case 'custom_graph': + case 'custom_graph': case 'automatic_custom_graph': $data["module"] = io_safe_output_xml (db_get_value ('nombre', 'tagente_modulo', 'id_agente_modulo', $content['id_agent_module'])); @@ -1400,7 +1400,6 @@ foreach ($contents as $content) { case 'netflow_data': case 'netflow_statistics': case 'netflow_summary': - // Read the report item $report_id = $report['id_report']; $content_id = $content['id_rc']; @@ -1416,13 +1415,15 @@ foreach ($contents as $content) { $start_date = $end_date - $period; // Get item filters - $filter = db_get_row_sql("SELECT * FROM tnetflow_filter WHERE id_sg = '" . (int)$content['text'] . "'", false, true); + $filter = db_get_row_sql("SELECT * + FROM tnetflow_filter + WHERE id_sg = '" . (int)$content['text'] . "'", false, true); if ($description == '') { $description = io_safe_output ($filter['id_name']); } // Build a unique id for the cache - $unique_id = $report_id . '_' . $content_id . '_' . ($end_date - $start_date); + //$unique_id = $report_id . '_' . $content_id . '_' . ($end_date - $start_date); $table->colspan[0][0] = 4; if ($filter['aggregate'] != 'none') { @@ -1432,8 +1433,10 @@ foreach ($contents as $content) { $data["title"] = $description . ' (' . __($filter['output']) . ')'; } - $data["objdata"]["netflow"] = netflow_draw_item ($start_date, $end_date, $resolution, $type, $filter, $max_aggregates, $unique_id, $server_name, 'XML'); + //$data["objdata"]["netflow"] = netflow_draw_item ($start_date, $end_date, $resolution, $type, $filter, $max_aggregates, $unique_id, $server_name, 'XML'); + $data["objdata"]["netflow"] = netflow_draw_item ($start_date, $end_date, $resolution, $type, $filter, $max_aggregates, $server_name, 'XML'); $buffer_file["objdata"] = $config['attachment_store'] . '/netflow_' . $time.'_'.$content['id_rc'] . '.tmp'; + $objdata_file = true; break; }