[API ACL] More get functions (2)

This commit is contained in:
fermin831 2018-06-06 19:39:57 +02:00
parent 7f2d583f63
commit b3bdd5d492
1 changed files with 17 additions and 10 deletions

View File

@ -4983,10 +4983,17 @@ function api_set_tag($id, $thrash1, $other, $thrash3) {
*/
function api_get_all_planned_downtimes ($thrash1, $thrash2, $other, $returnType = 'json') {
global $config;
if (defined ('METACONSOLE')) {
return;
}
if(!check_acl($config['id_user'], 0, "AR")) {
returnError('forbidden', $returnType);
return;
}
$values = array();
$values = array(
"name LIKE '%".$other['data'][0]."%'"
@ -5004,6 +5011,11 @@ function api_get_all_planned_downtimes ($thrash1, $thrash2, $other, $returnType
$returned = all_planned_downtimes($values);
if ($returned === false) {
returnError("error_get_all_planned_downtimes", __('No planned downtime retrieved'));
return;
}
returnData($returnType,
array('type' => 'array', 'data' => $returned));
}
@ -10135,12 +10147,7 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4) {
return;
}
$id_exist = (bool) db_get_value ('id_agente_modulo', 'tagente_modulo', 'id_agente_modulo', $id_module);
if (!$id_exist) {
// returnError('id_not_found');
return;
}
if (!api_check_agent_and_print_error(modules_get_agentmodule($id_module), 'string')) return;
$graph_seconds =
(!empty($other) && isset($other['data'][0]))