From b625f2e5c81f7d6c5b15ecae571574c6309286f3 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 19 Jun 2018 19:07:36 +0200 Subject: [PATCH] Changed GET to POST in web2image --- pandora_console/include/chart_generator.php | 18 +++++------ pandora_console/include/web2image.js | 34 ++++++++++----------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/pandora_console/include/chart_generator.php b/pandora_console/include/chart_generator.php index 86388515f2..45d0582cb5 100644 --- a/pandora_console/include/chart_generator.php +++ b/pandora_console/include/chart_generator.php @@ -13,9 +13,9 @@ // GNU General Public License for more details. // Global & session manageme -session_id($_GET["session_id"]); +session_id($_REQUEST["session_id"]); if (file_exists(session_save_path() . "/pansess_" . session_id())) { - $user = file_get_contents(session_save_path() . "/pansess_" . session_id()); + $user = file_request_contents(session_save_path() . "/pansess_" . session_id()); } session_start(); if (isset($user)) { @@ -39,12 +39,12 @@ check_login(); global $config; -$params = json_decode($_GET['data'], true); +$params = json_decode($_REQUEST['data'], true); // Metaconsole connection to the node $server_id = $params['server_id']; if ($config["metaconsole"] && !empty($server_id)) { - $server = metaconsole_get_connection_by_id($server_id); + $server = metaconsole_request_connection_by_id($server_id); // Error connecting if (metaconsole_connect($server) !== NOERR) { echo ""; @@ -68,7 +68,7 @@ if (file_exists ('languages/'.$user_language.'.mo')) { - Pandora FMS Graph (<?php echo agents_get_alias($agent_id) . ' - ' . $interface_name; ?>) + Pandora FMS Graph (<?php echo agents_request_alias($agent_id) . ' - ' . $interface_name; ?>) @@ -95,13 +95,13 @@ if (file_exists ('languages/'.$user_language.'.mo')) { '; diff --git a/pandora_console/include/web2image.js b/pandora_console/include/web2image.js index 1dab3be266..f5fd552e5c 100644 --- a/pandora_console/include/web2image.js +++ b/pandora_console/include/web2image.js @@ -4,7 +4,7 @@ if (system.args.length < 3 || system.args.length > 11) { phantom.exit(1); } -var webPage = require('webpage'); +var webPage = require('webpage'); var page = webPage.create(); var url = system.args[1]; var type_graph_pdf = system.args[2]; @@ -12,39 +12,37 @@ var url_params = system.args[3]; var url_params_comb = system.args[4]; var url_module_list = system.args[5]; var output_filename = system.args[6]; -var _width = system.args[7]; -var _height = system.args[8]; +var viewport_width = system.args[7]; +var viewport_height = system.args[8]; var session_id = system.args[9]; var base_64 = system.args[10]; -if (!_width) { - _width = 750; +if (!viewport_width) { + viewport_width = 750; } -if (!_height) { - _height = 350; +if (!viewport_height) { + viewport_height = 350; } 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 + - "&session_id=" + session_id; + post_data = "data=" + url_params + + "&data_combined=" + url_params_comb + + "&data_module_list=" + url_module_list + + "&type_graph_pdf=" + type_graph_pdf + + "&session_id=" + session_id; } else{ - finish_url = url + "?" + "data=" + url_params + - "&type_graph_pdf=" + type_graph_pdf + - "&session_id=" + session_id; + post_data = "data=" + url_params + + "&type_graph_pdf=" + type_graph_pdf + + "&session_id=" + session_id; } page.viewportSize = { width: _width, height: _height }; //page.zoomFactor = 1.75; -page.open(finish_url, function start(status) { - -}); +page.open(post_data, 'POST', post_data, function start(status) {}); page.onLoadFinished = function (status) { if(!base_64){