From 81ae7fdb08fcf85f09b6f745ea7498104d7973e7 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 27 Jan 2023 12:41:06 +0100 Subject: [PATCH] fix filter events sounds pandora_enterprise#10188 --- pandora_console/include/ajax/events.php | 31 ++++++++++++++++++++ pandora_console/include/functions_events.php | 1 - 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index d9be30cc33..bfff7a1171 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -2493,6 +2493,37 @@ if ($get_events_fired) { $filter = events_get_event_filter($filter_id); } + if (is_metaconsole() === true) { + $servers = metaconsole_get_servers(); + if (is_array($servers) === true) { + $servers = array_reduce( + $servers, + function ($carry, $item) { + $carry[$item['id']] = $item['server_name']; + return $carry; + } + ); + } else { + $servers = []; + } + + if ($filter['server_id'] === '') { + $filter['server_id'] = array_keys($servers); + } else { + if (is_array($filter['server_id']) === false) { + if (is_numeric($filter['server_id']) === true) { + if ($filter['server_id'] !== 0) { + $filter['server_id'] = [$filter['server_id']]; + } else { + $filter['server_id'] = array_keys($servers); + } + } else { + $filter['server_id'] = explode(',', $filter['server_id']); + } + } + } + } + // Set time. $filter['event_view_hr'] = 0; diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 3740257717..48ef7b2c30 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -4948,7 +4948,6 @@ function events_page_general_acknowledged($event_id) global $config; $Acknowledged = ''; $event = db_get_row('tevento', 'id_evento', $event_id); - hd($event['ack_utimestamp'], true); if ($event !== false && $event['estado'] == 1) { $user_ack = db_get_value( 'fullname',