From 701c11a4570d4e63a09186599c3ad308eef60deb Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Thu, 6 Jun 2019 14:52:39 +0200 Subject: [PATCH] Added event in process status validation when same extra id --- pandora_console/include/functions_api.php | 2 +- pandora_server/lib/PandoraFMS/Core.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 894e3afcf8..e683b74f7d 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -11519,7 +11519,7 @@ function api_set_create_event($id, $trash1, $other, $returnType) if ($other['data'][18] != '') { $values['id_extra'] = $other['data'][18]; - $sql_validation = 'SELECT id_evento FROM tevento where estado not in (1) and id_extra ="'.$other['data'][18].'";'; + $sql_validation = 'SELECT id_evento FROM tevento where estado IN (0,2) and id_extra ="'.$other['data'][18].'";'; $validation = db_get_all_rows_sql($sql_validation); if ($validation) { foreach ($validation as $val) { diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 0dbc8f963a..8117f2ee9d 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -3352,7 +3352,7 @@ sub pandora_event ($$$$$$$$$$;$$$$$$$$$$$) { # Validate events with the same event id if (defined ($id_extra) && $id_extra ne '') { logger($pa_config, "Updating events with extended id '$id_extra'.", 10); - db_do ($dbh, 'UPDATE ' . $event_table . ' SET estado = 1, ack_utimestamp = ? WHERE estado = 0 AND id_extra=?', $utimestamp, $id_extra); + db_do ($dbh, 'UPDATE ' . $event_table . ' SET estado = 1, ack_utimestamp = ? WHERE estado IN (1,2) AND id_extra=?', $utimestamp, $id_extra); } # Create the event