Merge branch 'ent-6762-10981-10968' into 'develop'

fix api function show graph

See merge request artica/pandorafms!3636
This commit is contained in:
Daniel Rodriguez 2020-12-04 09:44:39 +01:00
commit 9d5759e0f3
2 changed files with 12 additions and 7 deletions

View File

@ -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(

View File

@ -13766,12 +13766,19 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4)
return;
}
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;
$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', __(''));