diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 260bd2c166..cbeb0ead02 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -11310,7 +11310,7 @@ function api_get_events($node_id, $trash2, $other, $returnType) $separator = (isset($other['data'][0]) === true && empty($other['data'][0]) === false) ? $other['data'][0] : ';'; if (is_metaconsole() === true) { - if (empty($node_id) === true && (int) $node_id !== 0) { + if (empty($node_id) === true && $node_id != 0) { $node_id = array_keys(metaconsole_get_names(['disabled' => 0])); $node_id[] = 0; } else { diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index d7854b81c3..df90f261cd 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -800,7 +800,7 @@ function events_get_all( } } - if (isset($filter['severity']) === true) { + if (isset($filter['severity']) === true && $filter['severity'] !== '') { if (is_array($filter['severity']) === true) { if (in_array(-1, $filter['severity']) === false) { $not_normal = array_search(EVENT_CRIT_NOT_NORMAL, $filter['severity']); @@ -1033,14 +1033,13 @@ function events_get_all( // Prepare agent join sql filters. $table = 'tevento'; $tevento = 'tevento te'; - $agent_join_filters = []; $tagente_table = 'tagente'; $tagente_field = 'id_agente'; $conditionMetaconsole = ''; // Agent alias. if (empty($filter['agent_alias']) === false) { - $agent_join_filters[] = sprintf( + $sql_filters[] = sprintf( ' AND ta.alias = "%s" ', $filter['agent_alias'] ); @@ -1561,7 +1560,6 @@ function events_get_all( %s JOIN %s ta ON ta.%s = te.id_agente %s - %s %s JOIN tgrupo tg ON %s WHERE 1=1 @@ -1577,7 +1575,6 @@ function events_get_all( %s JOIN %s ta ON ta.%s = te.id_agente %s - %s %s JOIN tgrupo tg ON %s %s @@ -1593,7 +1590,6 @@ function events_get_all( $tagente_table, $tagente_field, $conditionMetaconsole, - join(' ', $agent_join_filters), $tgrupo_join, join(' ', $tgrupo_join_filters), join(' ', $sql_filters), @@ -1607,7 +1603,6 @@ function events_get_all( $tagente_table, $tagente_field, $conditionMetaconsole, - join(' ', $agent_join_filters), $tgrupo_join, join(' ', $tgrupo_join_filters), join(' ', $sql_filters), @@ -1623,7 +1618,6 @@ function events_get_all( %s JOIN %s ta ON ta.%s = te.id_agente %s - %s %s JOIN tgrupo tg ON %s WHERE 1=1 @@ -1642,7 +1636,6 @@ function events_get_all( $tagente_table, $tagente_field, $conditionMetaconsole, - join(' ', $agent_join_filters), $tgrupo_join, join(' ', $tgrupo_join_filters), join(' ', $sql_filters),