mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'ent-6405-Borrado-conf-md5-data_in-borrar-agente' into 'develop'
Adding delete_agent control for meta Closes pandora_enterprise#6405 See merge request artica/pandorafms!3583
This commit is contained in:
commit
24b71e477b
@ -1888,24 +1888,19 @@ function api_set_delete_agent($id, $thrash1, $other, $thrash3)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Delete only if the centralised mode is disabled.
|
// Delete only if the centralised mode is disabled.
|
||||||
if (is_central_policies_on_node()) {
|
$headers = getallheaders();
|
||||||
|
if (isset($headers['idk']) === false || is_management_allowed($headers['idk']) === false) {
|
||||||
returnError('centralized');
|
returnError('centralized');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Support for Pandora Enterprise.
|
||||||
|
if (license_free() === false) {
|
||||||
|
define('PANDORA_ENTERPRISE', true);
|
||||||
|
}
|
||||||
|
|
||||||
if ($agent_by_alias) {
|
if ($agent_by_alias) {
|
||||||
$idsAgents = agents_get_agent_id_by_alias(io_safe_input($id));
|
$idsAgents = agents_get_agent_id_by_alias(io_safe_input($id));
|
||||||
} else {
|
|
||||||
$idAgent = agents_get_agent_id($id, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$agent_by_alias) {
|
|
||||||
if (!util_api_check_agent_and_print_error($idAgent, 'string', 'AD')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($agent_by_alias) {
|
|
||||||
foreach ($idsAgents as $id) {
|
foreach ($idsAgents as $id) {
|
||||||
if (!util_api_check_agent_and_print_error($id['id_agente'], 'string', 'AD')) {
|
if (!util_api_check_agent_and_print_error($id['id_agente'], 'string', 'AD')) {
|
||||||
continue;
|
continue;
|
||||||
@ -1918,6 +1913,11 @@ function api_set_delete_agent($id, $thrash1, $other, $thrash3)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$idAgent = agents_get_agent_id($id, true);
|
||||||
|
if (!util_api_check_agent_and_print_error($idAgent, 'string', 'AD')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$result = agents_delete_agent($idAgent, true);
|
$result = agents_delete_agent($idAgent, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user