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