From 795620f90f4d80763e8046be8dc2fb7cfc613faa Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Tue, 4 Dec 2018 15:55:39 +0100 Subject: [PATCH] added success and error messages to api functions api_set_create_os and api_set_update_os --- pandora_console/include/functions_api.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 3cc0e58a67..3f01f14ecd 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -1410,10 +1410,6 @@ function api_set_create_os($thrash1, $thrash2, $other, $thrash3) { returnError('forbidden', 'string'); return; } - - if (defined ('METACONSOLE')) { - return; - } $values = array(); @@ -1429,6 +1425,11 @@ function api_set_create_os($thrash1, $thrash2, $other, $thrash3) { $resultOrId = false; if ($other['data'][0] != '') { $resultOrId = db_process_sql_insert('tconfig_os', $values); + + if ($resultOrId) + echo __('Success creating OS'); + else + echo __('Error creating OS'); } } @@ -1436,10 +1437,6 @@ function api_set_create_os($thrash1, $thrash2, $other, $thrash3) { function api_set_update_os($id_os, $thrash2, $other, $thrash3) { global $config; - if (defined ('METACONSOLE')) { - return; - } - if (!check_acl($config['id_user'], 0, "AW")) { returnError('forbidden', 'string'); return; @@ -1457,7 +1454,10 @@ function api_set_update_os($id_os, $thrash2, $other, $thrash3) { if ($other['data'][0] != '') { - $result = db_process_sql_update('tconfig_os', $values, array('id_os' => $id_os)); + if (db_process_sql_update('tconfig_os', $values, array('id_os' => $id_os))) + echo __('Success updating OS'); + else + echo __('Error updating OS'); } }