Adding delete_agent control for meta

This commit is contained in:
Jose Gonzalez 2020-10-28 17:56:42 +01:00
parent 3b9558c7a0
commit e300f2244d
1 changed files with 7 additions and 1 deletions

View File

@ -1885,11 +1885,17 @@ function api_set_delete_agent($id, $thrash1, $other, $thrash3)
}
} else {
// Delete only if the centralised mode is disabled.
if (is_central_policies_on_node()) {
$headers = getallheaders();
if (!isset($headers['idk']) || !is_management_allowed($headers['idk'])) {
returnError('centralized');
exit;
}
// Support for Pandora Enterprise.
if (license_free() === false) {
define('PANDORA_ENTERPRISE', true);
}
if ($agent_by_alias) {
$idsAgents = agents_get_agent_id_by_alias(io_safe_input($id));
} else {