From d28bc79b797abfb86ee458e8a0a896f2ea0116b4 Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 15 Oct 2018 09:05:04 +0200 Subject: [PATCH] upgrade php --- pandora_console/include/config_process.php | 4 +- pandora_console/include/functions_graph.php | 15 ++---- .../include/functions_reporting.php | 48 +++++++------------ .../include/functions_reporting_html.php | 5 +- pandora_console/include/load_session.php | 2 +- 5 files changed, 28 insertions(+), 46 deletions(-) diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 79ec9198aa..20305db287 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ */ /** - * Pandora build version and version + * Pandora build version and version */ $build_version = 'PC181015'; $pandora_version = 'v7.0NG.727'; @@ -78,7 +78,7 @@ else { // Check if mysqli is available if (!(isset($config["mysqli"]))) { - $config["mysqli"] = extension_loaded(mysqli); + $config["mysqli"] = extension_loaded('mysqli'); } $config['start_time'] = microtime (true); diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index f1b0de4b02..568eb3b1cb 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -3113,13 +3113,8 @@ function graph_custom_sql_graph ($id, $width, $height, } } } -//XXXXpie_graph + $flash_charts = $config['flash_charts']; -html_debug_print('entra'); - if ($only_image) { - $flash_charts = false; - $ttl =2; - } if($config["fixed_graph"] == false){ $water_mark = array('file' => @@ -3898,18 +3893,14 @@ function graph_netflow_aggregate_pie ($data, $aggregate, $ttl = 1, $only_image = $i++; } - $flash_chart = $config['flash_charts']; - if ($only_image) { - $flash_chart = false; - } - if($config["fixed_graph"] == false){ $water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png", 'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false)); } - return pie_graph($flash_chart, $values, 370, 200, + return pie_graph( + $values, 370, 200, __('Other'), $config['homeurl'], $water_mark, $config['fontpath'], $config['font_size'], $ttl); } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 1c1109536f..fcfee83eb2 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -1308,7 +1308,6 @@ function reporting_event_top_n($report, $content, $type = 'dinamic', if ($show_graph != REPORT_TOP_N_ONLY_TABLE) { arsort($data_pie_graph); $return['charts']['pie'] = pie_graph( - false, $data_pie_graph, $width, $height, __("other"), @@ -1462,7 +1461,6 @@ function reporting_event_report_group($report, $content, $filter_event_status, $filter_event_filter_search); $return['chart']['by_agent']= pie_graph( - false, $data_graph, 500, 150, @@ -1482,7 +1480,6 @@ function reporting_event_report_group($report, $content, $filter_event_status, $filter_event_filter_search); $return['chart']['by_user_validator'] = pie_graph( - false, $data_graph, 500, 150, @@ -1504,7 +1501,6 @@ function reporting_event_report_group($report, $content, $colors = get_criticity_pie_colors($data_graph); $return['chart']['by_criticity'] = pie_graph( - false, $data_graph, 500, 150, @@ -1526,7 +1522,6 @@ function reporting_event_report_group($report, $content, $filter_event_status, $filter_event_filter_search); $return['chart']['validated_vs_unvalidated'] = pie_graph( - false, $data_graph, 500, 150, @@ -2201,7 +2196,6 @@ function reporting_exception($report, $content, $type = 'dinamic', $return["chart"]["pie"] = pie_graph( - false, $data_pie_graph, 600, 150, @@ -2384,7 +2378,6 @@ function reporting_event_report_agent($report, $content, $filter_event_status, $filter_event_filter_search); $return["chart"]["by_user_validator"] = pie_graph( - false, $data_graph, 500, 150, @@ -2406,7 +2399,6 @@ function reporting_event_report_agent($report, $content, $colors = get_criticity_pie_colors($data_graph); $return["chart"]["by_criticity"] = pie_graph( - false, $data_graph, 500, 150, @@ -2428,7 +2420,6 @@ function reporting_event_report_agent($report, $content, $filter_event_status, $filter_event_filter_search); $return["chart"]["validated_vs_unvalidated"] = pie_graph( - false, $data_graph, 500, 150, @@ -6569,30 +6560,30 @@ function reporting_get_module_detailed_event ($id_modules, $period = 0, $filter_event_filter_search = false, $force_width_chart = false, $event_graph_by_user_validator = false, $event_graph_by_criticity = false, $event_graph_validated_vs_unvalidated = false, $ttl = 1, $id_server = false) { - + global $config; - + $id_modules = (array)safe_int ($id_modules, 1); - + if (!is_numeric ($date)) { $date = strtotime ($date); } if (empty ($date)) { $date = get_system_time (); } - + $history = false; if ($config['history_event_enabled']) $history = true; - + $events = array (); - + foreach ($id_modules as $id_module) { - $event['data'] = events_get_agent (false, (int) $period, (int) $date, - $history, $show_summary_group, $filter_event_severity, - $filter_event_type, $filter_event_status, $filter_event_filter_search, + $event['data'] = events_get_agent (false, (int) $period, (int) $date, + $history, $show_summary_group, $filter_event_severity, + $filter_event_type, $filter_event_status, $filter_event_filter_search, false, false, $id_module, true , $id_server); - + //total_events if(isset($event['data'])){ $event['total_events'] = count($event['data']); @@ -6605,18 +6596,17 @@ function reporting_get_module_detailed_event ($id_modules, $period = 0, if (!empty($force_width_chart)) { $width = $force_width_chart; } - + if (!empty($force_height_chart)) { $height = $force_height_chart; } - + if ($event_graph_by_user_validator) { $data_graph = events_get_count_events_validated_by_user( array('id_agentmodule' => $id_module), $period, $date, $filter_event_severity, $filter_event_type, $filter_event_status, $filter_event_filter_search); - + $event['chart']['by_user_validator'] = pie_graph( - false, $data_graph, 500, 150, @@ -6628,16 +6618,15 @@ function reporting_get_module_detailed_event ($id_modules, $period = 0, $ttl ); } - + if ($event_graph_by_criticity) { $data_graph = events_get_count_events_by_criticity( array('id_agentmodule' => $id_module), $period, $date, $filter_event_severity, $filter_event_type, $filter_event_status, $filter_event_filter_search); - + $colors = get_criticity_pie_colors($data_graph); - + $event['chart']['by_criticity'] = pie_graph( - false, $data_graph, 500, 150, @@ -6651,14 +6640,13 @@ function reporting_get_module_detailed_event ($id_modules, $period = 0, $colors ); } - + if ($event_graph_validated_vs_unvalidated) { $data_graph = events_get_count_events_validated( array('id_agentmodule' => $id_module), $period, $date, $filter_event_severity, $filter_event_type, $filter_event_status, $filter_event_filter_search); - + $event['chart']['validated_vs_unvalidated'] = pie_graph( - false, $data_graph, 500, 150, diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 2afa8216a9..f4f0cb24dc 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -113,7 +113,10 @@ function html_do_report_info($report) { ' . __('Report date') . ': '; if (isset($report['period'])) { - $html .= '' . date($config["date_format"], ($report['datetime'] - $report['period'])); + if (is_numeric($report['datetime']) && is_numeric($report['period'])) { + $html .= '' . date($config["date_format"], ($report['datetime'] - $report['period'])) . ''; + } + $html .= ''; } else { $html .= '' . __('Items period before') . ' ' . date($config["date_format"], $report['datetime']) . ''; diff --git a/pandora_console/include/load_session.php b/pandora_console/include/load_session.php index b02f863348..8144b410b2 100644 --- a/pandora_console/include/load_session.php +++ b/pandora_console/include/load_session.php @@ -30,7 +30,7 @@ function pandora_session_read ($session_id) { if (!empty($session_data)) return $session_data; else - return false; + return ''; } function pandora_session_write ($session_id, $data) {