diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 869ec657a4..3dd05aaf4b 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2011-09-25 Miguel de Dios + + * include/functions_api.php: added api call "set_validate_event". + + * include/api.php: fixed the login process for do more Pandora standar. + 2011-09-23 Miguel de Dios * include/functions_api.php: added the code for the return the more diff --git a/pandora_console/include/api.php b/pandora_console/include/api.php index 4c5513c26a..3c2bd26c25 100644 --- a/pandora_console/include/api.php +++ b/pandora_console/include/api.php @@ -15,6 +15,9 @@ require_once ("config.php"); require_once("functions_api.php"); + +global $config; + enterprise_include_once ('include/functions_enterprise_api.php'); $ipOrigin = $_SERVER['REMOTE_ADDR']; @@ -43,6 +46,7 @@ if (!empty($apiPassword)) { else { $user_in_db = process_user_login($user, $password); if ($user_in_db !== false) { + $config['id_user'] = $user_in_db; $correctLogin = true; } } diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 8e74bab56c..319cb4ede6 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -1512,6 +1512,23 @@ function set_event_validate_filter($trash1, $trash2, $other, $trash3) { } } +function set_validate_events($id_event, $trash1, $other, $return_type, $user_in_db) { + $text = $other['data']; + + // Set off the standby mode when close an event + $event = events_get_event ($id_event); + alerts_agent_module_standby ($event['id_alert_am'], 0); + + $result = events_validate_event ($id_event, false, $text); + + if ($result) { + returnData('string', array('type' => 'string', 'data' => 'Correct validation')); + } + else { + returnError('error_validate_event', 'Error in validation operation.'); + } +} + function get_events__with_user($trash1, $trash2, $other, $returnType, $user_in_db) { global $config;