From a1822102db1e89681ea1e838b53bf77951a570ff Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 7 Nov 2013 15:47:17 +0000 Subject: [PATCH] 2013-11-07 Miguel de Dios * include/functions_api.php: fixed the validate event with the new validation form. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9032 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_api.php | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 48ca5df70f..485d078697 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2013-11-07 Miguel de Dios + + * include/functions_api.php: fixed the validate event with the + new validation form. + 2013-11-07 Ramon Novoa * godmode/agentes/modificar_agente.php: Fixed a duplicated id. diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 5a7297ad3e..30587c2998 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -5176,10 +5176,16 @@ function api_set_validate_events($id_event, $trash1, $other, $return_type, $user $event = events_get_event ($id_event); alerts_agent_module_standby ($event['id_alert_am'], 0); - $result = events_validate_event ($id_event, false, $text); + $result = events_validate_event ($id_event, false, 1); if ($result) { - returnData('string', array('type' => 'string', 'data' => 'Correct validation')); + if (!empty($text)) { + //Set the comment for the validation + events_comment($id_event, $text); + } + + returnData('string', + array('type' => 'string', 'data' => 'Correct validation')); } else { returnError('Error in validation operation.');