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:
commit
1526aa6eee
|
@ -1413,10 +1413,6 @@ function api_set_create_os($thrash1, $thrash2, $other, $thrash3) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (defined ('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$values = array();
|
||||
|
||||
$values['name'] = $other['data'][0];
|
||||
|
@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue