added success and error messages to api functions api_set_create_os and api_set_update_os

This commit is contained in:
alejandro-campos 2018-12-04 15:55:39 +01:00
parent 4b1649d5f8
commit 795620f90f
1 changed files with 9 additions and 9 deletions

View File

@ -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');
}
}