Merge branch '2501-Crear-SO-con-la-API-2' into 'develop'

added success and error messages to api functions api_set_create_os and api_set_update_os

See merge request artica/pandorafms!2043

Former-commit-id: aaa52d060a7e61f1ed3bb3530c5b452db1c0def6
This commit is contained in:
vgilc 2018-12-05 08:34:56 +01:00
commit 1526aa6eee
1 changed files with 9 additions and 9 deletions

View File

@ -1412,10 +1412,6 @@ function api_set_create_os($thrash1, $thrash2, $other, $thrash3) {
returnError('forbidden', 'string');
return;
}
if (defined ('METACONSOLE')) {
return;
}
$values = array();
@ -1431,6 +1427,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');
}
}
@ -1438,10 +1439,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;
@ -1459,7 +1456,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');
}
}