Changed GET to POST in web2image
This commit is contained in:
parent
4214577eea
commit
b625f2e5c8
|
@ -13,9 +13,9 @@
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// Global & session manageme
|
// Global & session manageme
|
||||||
session_id($_GET["session_id"]);
|
session_id($_REQUEST["session_id"]);
|
||||||
if (file_exists(session_save_path() . "/pansess_" . 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();
|
session_start();
|
||||||
if (isset($user)) {
|
if (isset($user)) {
|
||||||
|
@ -39,12 +39,12 @@ check_login();
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$params = json_decode($_GET['data'], true);
|
$params = json_decode($_REQUEST['data'], true);
|
||||||
// Metaconsole connection to the node
|
// Metaconsole connection to the node
|
||||||
$server_id = $params['server_id'];
|
$server_id = $params['server_id'];
|
||||||
|
|
||||||
if ($config["metaconsole"] && !empty($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
|
// Error connecting
|
||||||
if (metaconsole_connect($server) !== NOERR) {
|
if (metaconsole_connect($server) !== NOERR) {
|
||||||
echo "<html>";
|
echo "<html>";
|
||||||
|
@ -68,7 +68,7 @@ if (file_exists ('languages/'.$user_language.'.mo')) {
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<title>Pandora FMS Graph (<?php echo agents_get_alias($agent_id) . ' - ' . $interface_name; ?>)</title>
|
<title>Pandora FMS Graph (<?php echo agents_request_alias($agent_id) . ' - ' . $interface_name; ?>)</title>
|
||||||
<link rel="stylesheet" href="styles/pandora.css" type="text/css" />
|
<link rel="stylesheet" href="styles/pandora.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="styles/pandora_minimal.css" type="text/css" />
|
<link rel="stylesheet" href="styles/pandora_minimal.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="styles/jquery-ui-1.10.0.custom.css" type="text/css" />
|
<link rel="stylesheet" href="styles/jquery-ui-1.10.0.custom.css" type="text/css" />
|
||||||
|
@ -95,13 +95,13 @@ if (file_exists ('languages/'.$user_language.'.mo')) {
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
$params['only_image'] = false;
|
$params['only_image'] = false;
|
||||||
$params['width'] = '1048';
|
$params['width'] = '1048';
|
||||||
$params['menu'] = false;
|
$params['menu'] = false;
|
||||||
|
|
||||||
$params_combined = json_decode($_GET['data_combined'], true);
|
$params_combined = json_decode($_REQUEST['data_combined'], true);
|
||||||
$module_list = json_decode($_GET['data_module_list'], true);
|
$module_list = json_decode($_REQUEST['data_module_list'], true);
|
||||||
$type_graph_pdf = $_GET['type_graph_pdf'];
|
$type_graph_pdf = $_REQUEST['type_graph_pdf'];
|
||||||
|
|
||||||
if($type_graph_pdf == 'combined'){
|
if($type_graph_pdf == 'combined'){
|
||||||
echo '<div>';
|
echo '<div>';
|
||||||
|
|
|
@ -4,7 +4,7 @@ if (system.args.length < 3 || system.args.length > 11) {
|
||||||
phantom.exit(1);
|
phantom.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
var webPage = require('webpage');
|
var webPage = require('webpage');
|
||||||
var page = webPage.create();
|
var page = webPage.create();
|
||||||
var url = system.args[1];
|
var url = system.args[1];
|
||||||
var type_graph_pdf = system.args[2];
|
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_params_comb = system.args[4];
|
||||||
var url_module_list = system.args[5];
|
var url_module_list = system.args[5];
|
||||||
var output_filename = system.args[6];
|
var output_filename = system.args[6];
|
||||||
var _width = system.args[7];
|
var viewport_width = system.args[7];
|
||||||
var _height = system.args[8];
|
var viewport_height = system.args[8];
|
||||||
var session_id = system.args[9];
|
var session_id = system.args[9];
|
||||||
var base_64 = system.args[10];
|
var base_64 = system.args[10];
|
||||||
|
|
||||||
|
|
||||||
if (!_width) {
|
if (!viewport_width) {
|
||||||
_width = 750;
|
viewport_width = 750;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_height) {
|
if (!viewport_height) {
|
||||||
_height = 350;
|
viewport_height = 350;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(type_graph_pdf == 'combined'){
|
if(type_graph_pdf == 'combined'){
|
||||||
finish_url = url + "?" + "data=" + url_params +
|
post_data = "data=" + url_params +
|
||||||
"&data_combined=" + url_params_comb +
|
"&data_combined=" + url_params_comb +
|
||||||
"&data_module_list=" + url_module_list +
|
"&data_module_list=" + url_module_list +
|
||||||
"&type_graph_pdf=" + type_graph_pdf +
|
"&type_graph_pdf=" + type_graph_pdf +
|
||||||
"&session_id=" + session_id;
|
"&session_id=" + session_id;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
finish_url = url + "?" + "data=" + url_params +
|
post_data = "data=" + url_params +
|
||||||
"&type_graph_pdf=" + type_graph_pdf +
|
"&type_graph_pdf=" + type_graph_pdf +
|
||||||
"&session_id=" + session_id;
|
"&session_id=" + session_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
page.viewportSize = { width: _width, height: _height };
|
page.viewportSize = { width: _width, height: _height };
|
||||||
//page.zoomFactor = 1.75;
|
//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) {
|
page.onLoadFinished = function (status) {
|
||||||
if(!base_64){
|
if(!base_64){
|
||||||
|
|
Loading…
Reference in New Issue