diff --git a/pandora_console/include/api.php b/pandora_console/include/api.php index 1161786e97..b7bfb2e508 100644 --- a/pandora_console/include/api.php +++ b/pandora_console/include/api.php @@ -55,8 +55,6 @@ $password = get_parameter('pass', ''); $user = get_parameter('user', ''); $info = get_parameter('info', ''); -$other = parseOtherParameter($otherSerialize, $otherMode); - $other = parseOtherParameter($otherSerialize, $otherMode); $apiPassword = io_output_password( db_get_value_filter( diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index f3f976e183..96b3bc8cfa 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -13766,12 +13766,19 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4) return; } - $graph_seconds = (!empty($other) && isset($other['data'][0])) ? $other['data'][0] : SECONDS_1HOUR; - // 1 hour by default. - $graph_threshold = (!empty($other) && isset($other['data'][2]) && $other['data'][2]) ? $other['data'][2] : 0; + if (is_array($other['data']) === true) { + $graph_seconds = (!empty($other) && isset($other['data'][0])) ? $other['data'][0] : SECONDS_1HOUR; + // 1 hour by default. + $graph_threshold = (!empty($other) && isset($other['data'][2]) && $other['data'][2]) ? $other['data'][2] : 0; - // Graph height when send email by alert - $height = (!empty($other) && isset($other['data'][3]) && $other['data'][3]) ? $other['data'][3] : null; + // Graph height when send email by alert + $height = (!empty($other) && isset($other['data'][3]) && $other['data'][3]) ? $other['data'][3] : 225; + } else { + $graph_seconds = $other['data']; + $graph_threshold = 0; + $other['data'][1] = 0; + $height = 225; + } if (is_nan($graph_seconds) || $graph_seconds <= 0) { // returnError('error_module_graph', __(''));