diff --git a/pandora_console/include/chart_generator.php b/pandora_console/include/chart_generator.php index bec06cfada..fef8d1abeb 100644 --- a/pandora_console/include/chart_generator.php +++ b/pandora_console/include/chart_generator.php @@ -12,15 +12,11 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// XXX -/* -if (! isset($_SESSION['id_usuario'])) { - session_start(); - session_write_close(); -} -*/ - // Global & session manageme +session_id($_GET["session_id"]); +session_start(); +session_write_close(); + require_once ('config.php'); require_once ($config['homedir'] . '/include/auth/mysql.php'); require_once ($config['homedir'] . '/include/functions.php'); @@ -32,8 +28,9 @@ require_once ($config['homedir'] . '/include/functions_modules.php'); require_once ($config['homedir'] . '/include/functions_agents.php'); require_once ($config['homedir'] . '/include/functions_tags.php'); -// XXX -//check_login(); +check_login(); + +global $config; /* $params_json = base64_decode((string) get_parameter('params')); @@ -55,14 +52,14 @@ if ($config["metaconsole"] && !empty($server_id)) { exit; } } - +*/ $user_language = get_user_language($config['id_user']); if (file_exists ('languages/'.$user_language.'.mo')) { $l10n = new gettext_reader (new CachedFileReader ('languages/'.$user_language.'.mo')); $l10n->load_tables(); } -*/ + ?> @@ -95,12 +92,10 @@ if (file_exists ('languages/'.$user_language.'.mo')) { '; } } diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 48bab6cfdb..d25fc71b09 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -240,7 +240,7 @@ function grafico_modulo_sparse_data_chart ( $data_module_graph['id_module_type'] == 10 || $data_module_graph['id_module_type'] == 33 ){ -//XXXXXXXXXXX +//XXXXXXXXXXX SLICES /* "SELECT count(*) as data, min(utimestamp) as utimestamp FROM tagente_datos_string @@ -865,7 +865,6 @@ function grafico_modulo_sparse ($params) { $params['font'] = $config['fontpath']; $params['font-size'] = $config['font_size']; - //XXXXXXXXXXXX se devuelve phantom.js if($params['only_image']){ return generator_chart_to_pdf('sparse', $params); } @@ -1151,7 +1150,7 @@ function graphic_combined_module ( $params, $params_combined ) { - //XXX seteo todos los parametros + if(!isset($params_combined['from_interface'])){ $params_combined['from_interface'] = false; } @@ -1216,7 +1215,6 @@ function graphic_combined_module ( } - //XXX seteo los parametros if(!isset($params['period'])){ return false; } @@ -1320,7 +1318,7 @@ function graphic_combined_module ( } $params['graph_combined'] = true; - //XXXX + if($params['only_image']){ return generator_chart_to_pdf('combined', $params, $params_combined, $module_list); } @@ -1436,7 +1434,7 @@ function graphic_combined_module ( ); } - //XXX no se que hacen + //XXX arreglar estas $long_index = ''; $color = array(); @@ -1765,7 +1763,6 @@ function graphic_combined_module ( } } - //XXXX $graph_values = $temp; $width = 1024; @@ -1857,7 +1854,6 @@ function graphic_combined_module ( $i++; } - //XXXX $graph_values = $temp; $width = 200; @@ -1926,7 +1922,6 @@ function graphic_combined_module ( } } - //XXXX $graph_values = $temp; $width = 1024; @@ -2046,7 +2041,6 @@ function graphic_combined_module ( } $i++; - //XXXX $graph_values = $temp; return stacked_thermometers( @@ -2129,7 +2123,6 @@ function graphic_combined_module ( $temp['total_modules'] = $total_modules; - //XXXX $graph_values = $temp; $width = 1024; @@ -2319,7 +2312,6 @@ function graphic_agentaccess ($id_agent, $width, $height, $period = 0, $return = } } - //XXXXX if($config["fixed_graph"] == false){ $water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png", diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index df60e548ab..c17b4650af 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2805,21 +2805,6 @@ function agents_get_network_interfaces_array( $row_interface['status'] = $interface['status_image']; $row_interface['chart'] = null; - //XXXX ancho y largo - // Get chart - /* - reporting_set_conf_charts($width, $height, $only_image, - $type, $content, $ttl); - - if (!empty($force_width_chart)) { - $width = $force_width_chart; - } - - if (!empty($force_height_chart)) { - $height = $force_height_chart; - } - */ - $width = null; $height = null; @@ -3631,11 +3616,6 @@ function reporting_projection_graph($report, $content, set_time_limit(500); - // Get chart - //reporting_set_conf_charts($width, $height, $only_image, $type, - // $content, $ttl); - - //XXXX width y height switch ($type) { case 'dinamic': case 'static': @@ -6505,7 +6485,7 @@ function reporting_simple_graph($report, $content, $type = 'dinamic', 'period' => $content['period'], 'title' => $label, 'avg_only' => $only_avg, - 'pure' => false, //XXX + 'pure' => false, 'date' => $report["datetime"], 'only_image' => $only_image, 'homeurl' => ui_get_full_url(false, false, false, false), diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index 3d48567e6a..7ddd651830 100644 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -172,8 +172,7 @@ function vbar_graph( $backgroundColor = 'white', $from_ux = false, $from_wux = false, - $tick_color = 'white' -) { + $tick_color = 'white') { setup_watermark($water_mark, $water_mark_file, $water_mark_url); @@ -224,13 +223,12 @@ function area_graph( $agent_module_id, $array_data, $legend, $series_type, $date_array, $data_module_graph, $params, $water_mark, - $array_events_alerts -) { + $array_events_alerts) { global $config; include_once('functions_flot.php'); - //setup_watermark($water_mark, $water_mark_file, $water_mark_url); + setup_watermark($water_mark, $water_mark_file, $water_mark_url); return flot_area_graph( $agent_module_id, @@ -276,15 +274,15 @@ function stacked_thermometers($flash_chart, $chart_data, $width, $height, $color, $legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", $water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1, $homeurl = '', $backgroundColor = 'white') { - + include_once('functions_d3.php'); - + setup_watermark($water_mark, $water_mark_file, $water_mark_url); - + if (empty($chart_data)) { return ''; } - + return d3_thermometers( $chart_data, $width, @@ -323,23 +321,6 @@ function stacked_gauge($chart_data, $width, $height, ); } -function kiviat_graph($graph_type, $flash_chart, $chart_data, $width, - $height, $no_data_image, $ttl = 1, $homedir="") { - - if (empty($chart_data)) { - return ''; - } - - $graph = array(); - $graph['data'] = $chart_data; - $graph['width'] = $width; - $graph['height'] = $height; - - $id_graph = serialize_in_temp($graph, null, $ttl); - - return ""; -} - function hbar_graph($flash_chart, $chart_data, $width, $height, $color, $legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", $water_mark = "", $font = '', $font_size = '', diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index cd95fe957b..e5fe88e073 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -859,9 +859,8 @@ function pandoraFlotArea( graph_id, values, legend, agent_module_id, series_type, water_mark, date_array, data_module_graph, params, - force_integer, - background_color, legend_color, short_data, - events_array + force_integer, background_color, + legend_color, short_data, events_array ) { //diferents vars @@ -2397,8 +2396,6 @@ function get_event_details (event_ids) { return table; } - -//XXXXXXXXXX //Ajusta la grafica pequenña con el desplazamiento del eje y function adjust_left_width_canvas(adapter_id, adapted_id) { var adapter_left_margin = $('#'+adapter_id+' .yAxis .tickLabel').width(); @@ -2408,8 +2405,6 @@ function adjust_left_width_canvas(adapter_id, adapted_id) { $('#'+adapted_id).css('margin-left', adapter_left_margin); } - -//XXXXXXXXXXX //Ajusta el ancho de la grafica pequeña con respecto a la grande function update_left_width_canvas(graph_id) { $('#overview_'+graph_id).width($('#'+graph_id).width()); diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index d4dff7d964..558078f05c 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -129,7 +129,6 @@ function flot_area_graph ( break; } - ///XXXXXXX los px caca // Parent layer $return = "
"; // Set some containers to legend, graph, timestamp tooltip, etc. @@ -205,7 +204,7 @@ function flot_area_graph ( if($params['type'] == 'area_simple'){ $return .= "noresizevc "; } -//XXXXXX height: ".$params['height']."px;' + $return .= "graph" .$params['adapt_key'] ."' style=' width: ".$params['width']."px; height: ".$params['height']."px;'>
"; @@ -257,7 +256,6 @@ function flot_area_graph ( $legend_color = "#A4A4A4"; } - //XXXX force_integer TODO $force_integer = 0; // Trick to get translated string from javascript diff --git a/pandora_console/include/graphs/functions_utils.php b/pandora_console/include/graphs/functions_utils.php index affb826857..983a785dc4 100644 --- a/pandora_console/include/graphs/functions_utils.php +++ b/pandora_console/include/graphs/functions_utils.php @@ -136,16 +136,17 @@ function setup_watermark($water_mark, &$water_mark_file, &$water_mark_url) { if (!is_array($water_mark)) { $water_mark_file = $water_mark; $water_mark_url = ''; + return; } - + if (isset($water_mark['file'])) { $water_mark_file = $water_mark['file']; } else { $water_mark_file = ''; } - + if (isset($water_mark['url'])) { $water_mark_url = $water_mark['url']; } diff --git a/pandora_console/include/web2image.js b/pandora_console/include/web2image.js index a57dd8376d..1dab3be266 100644 --- a/pandora_console/include/web2image.js +++ b/pandora_console/include/web2image.js @@ -1,6 +1,6 @@ var system = require('system'); -if (system.args.length < 3 || system.args.length > 10) { +if (system.args.length < 3 || system.args.length > 11) { phantom.exit(1); } @@ -14,7 +14,9 @@ var url_module_list = system.args[5]; var output_filename = system.args[6]; var _width = system.args[7]; var _height = system.args[8]; -var base_64 = system.args[9]; +var session_id = system.args[9]; +var base_64 = system.args[10]; + if (!_width) { _width = 750; @@ -28,11 +30,13 @@ if(type_graph_pdf == 'combined'){ finish_url = url + "?" + "data=" + url_params + "&data_combined=" + url_params_comb + "&data_module_list=" + url_module_list + - "&type_graph_pdf=" + type_graph_pdf; + "&type_graph_pdf=" + type_graph_pdf + + "&session_id=" + session_id; } else{ finish_url = url + "?" + "data=" + url_params + - "&type_graph_pdf=" + type_graph_pdf; + "&type_graph_pdf=" + type_graph_pdf + + "&session_id=" + session_id; } page.viewportSize = { width: _width, height: _height }; diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index 7b36546fd9..04a0316355 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -192,7 +192,6 @@ $interface_traffic_modules = array( else echo '
'; - //XXXXXXX width and height $height = 400; $width = '90%'; diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index d8a0bdd3f6..f433fb626a 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -154,13 +154,6 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); $period = get_parameter ("period"); $id = get_parameter ("id", 0); - -//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - /* - $width = get_parameter ("width", STATWIN_DEFAULT_CHART_WIDTH); - $height = get_parameter ("height", STATWIN_DEFAULT_CHART_HEIGHT); - */ - $label = get_parameter ("label", ""); $label_graph = base64_decode(get_parameter ("label", "")); $start_date = get_parameter ("start_date", date("Y/m/d")); diff --git a/pandora_console/operation/reporting/graph_viewer.php b/pandora_console/operation/reporting/graph_viewer.php index f4973eec8f..970d36c994 100644 --- a/pandora_console/operation/reporting/graph_viewer.php +++ b/pandora_console/operation/reporting/graph_viewer.php @@ -190,8 +190,6 @@ if ($view_graph) { $options ); - - //XXXX el width y height $width = null; $height = null; $params =array(