added success and error messages to api functions api_set_create_os and api_set_update_os
This commit is contained in:
parent
4b1649d5f8
commit
795620f90f
|
@ -1410,10 +1410,6 @@ function api_set_create_os($thrash1, $thrash2, $other, $thrash3) {
|
||||||
returnError('forbidden', 'string');
|
returnError('forbidden', 'string');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined ('METACONSOLE')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$values = array();
|
$values = array();
|
||||||
|
|
||||||
|
@ -1429,6 +1425,11 @@ function api_set_create_os($thrash1, $thrash2, $other, $thrash3) {
|
||||||
$resultOrId = false;
|
$resultOrId = false;
|
||||||
if ($other['data'][0] != '') {
|
if ($other['data'][0] != '') {
|
||||||
$resultOrId = db_process_sql_insert('tconfig_os', $values);
|
$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) {
|
function api_set_update_os($id_os, $thrash2, $other, $thrash3) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if (defined ('METACONSOLE')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!check_acl($config['id_user'], 0, "AW")) {
|
if (!check_acl($config['id_user'], 0, "AW")) {
|
||||||
returnError('forbidden', 'string');
|
returnError('forbidden', 'string');
|
||||||
return;
|
return;
|
||||||
|
@ -1457,7 +1454,10 @@ function api_set_update_os($id_os, $thrash2, $other, $thrash3) {
|
||||||
|
|
||||||
if ($other['data'][0] != '') {
|
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