diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 64533b7c82..03cc57036e 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -9553,10 +9553,15 @@ function api_set_delete_special_day($id_special_day, $thrash2, $thrash3, $thrash * @param $thrash4 Don't use. * * example: - * api.php?op=get&op2=module_graph&id=1&other=3600 + * http://localhost/pandora_console/include/ + * api.php?op=get&op2=module_graph&id=5&other=40000%7C1&other_mode=url_encode_separator_%7C&apipass=1234 + * &api=1&user=admin&pass=pandora * */ function api_get_module_graph($id_module, $thrash2, $other, $thrash4) { + + global $config; + if (defined ('METACONSOLE')) { return; } @@ -9574,9 +9579,9 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4) { } $graph_seconds = - (!empty($other) && isset($other['data'])) + (!empty($other) && isset($other['data'][0])) ? - $other['data'] + $other['data'][0] : SECONDS_1HOUR; // 1 hour by default @@ -9636,7 +9641,7 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4) { // returnError('error_module_graph', __('')); } else { - if($other['data'] < 40000){ + if($other['data'][1]){ header('Content-type: text/html'); returnData('string', array('type' => 'string', 'data' => '')); } else { diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index dc788306dd..467d28723c 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1103,8 +1103,8 @@ sub pandora_execute_action ($$$$$$$$$;$) { my $subst_func = sub { my $hours = shift; my $period = $hours * 3600; # Hours to seconds - $params->{"other"} = $period; - + $params->{"other"} = $period . '%7C0'; + $params->{"other_mode"} = 'url_encode_separator_%7C'; my $cid = 'module_graph_' . $hours . 'h'; if (! exists($module_graph_list->{$cid}) && defined $url) {