Merge branch '843-Error-Perfil-en-copia-masiva-de-modulos' into 'develop'

fixed errors in massive copy modules

See merge request !451
This commit is contained in:
vgilc 2017-05-31 17:40:27 +02:00
commit e085a8a006
1 changed files with 28 additions and 7 deletions

View File

@ -17,13 +17,6 @@ global $config;
// Login check // Login check
check_login (); check_login ();
if (! check_acl ($config['id_user'], 0, "LW")) {
db_pandora_audit("ACL Violation",
"Trying to access Alert Management");
require ("general/noaccess.php");
exit;
}
require_once ('include/functions_agents.php'); require_once ('include/functions_agents.php');
require_once ('include/functions_alerts.php'); require_once ('include/functions_alerts.php');
$isFunctionPolicies = enterprise_include ('include/functions_policies.php'); $isFunctionPolicies = enterprise_include ('include/functions_policies.php');
@ -49,6 +42,13 @@ if ($get_agent_alerts_simple) {
return; return;
} }
if (! check_acl ($config['id_user'], 0, "LW")) {
db_pandora_audit("ACL Violation",
"Trying to access Alert Management");
echo json_encode (false);
return;
}
require_once ('include/functions_agents.php'); require_once ('include/functions_agents.php');
require_once ('include/functions_alerts.php'); require_once ('include/functions_alerts.php');
require_once ('include/functions_modules.php'); require_once ('include/functions_modules.php');
@ -73,6 +73,12 @@ if ($get_agent_alerts_simple) {
} }
if ($enable_alert) { if ($enable_alert) {
if (! check_acl ($config['id_user'], 0, "LW")) {
db_pandora_audit("ACL Violation",
"Trying to access Alert Management");
return false;
}
$id_alert = (int) get_parameter ('id_alert'); $id_alert = (int) get_parameter ('id_alert');
$result = alerts_agent_module_disable ($id_alert, false); $result = alerts_agent_module_disable ($id_alert, false);
@ -84,6 +90,11 @@ if ($enable_alert) {
} }
if ($disable_alert) { if ($disable_alert) {
if (! check_acl ($config['id_user'], 0, "LW")) {
db_pandora_audit("ACL Violation",
"Trying to access Alert Management");
return false;
}
$id_alert = (int) get_parameter ('id_alert'); $id_alert = (int) get_parameter ('id_alert');
$result = alerts_agent_module_disable ($id_alert, true); $result = alerts_agent_module_disable ($id_alert, true);
@ -95,6 +106,11 @@ if ($disable_alert) {
} }
if ($get_actions_module) { if ($get_actions_module) {
if (! check_acl ($config['id_user'], 0, "LW")) {
db_pandora_audit("ACL Violation",
"Trying to access Alert Management");
return false;
}
$id_module = get_parameter ('id_module'); $id_module = get_parameter ('id_module');
if (empty($id_module)) if (empty($id_module))
@ -107,6 +123,11 @@ if ($get_actions_module) {
} }
if ($show_update_action_menu) { if ($show_update_action_menu) {
if (! check_acl ($config['id_user'], 0, "LW")) {
db_pandora_audit("ACL Violation",
"Trying to access Alert Management");
return false;
}
$id_agent_module = (int) get_parameter ('id_agent_module'); $id_agent_module = (int) get_parameter ('id_agent_module');
$id_module_action = (int) get_parameter ('id_module_action'); $id_module_action = (int) get_parameter ('id_module_action');
$id_agent = (int) get_parameter ('id_agent'); $id_agent = (int) get_parameter ('id_agent');