Merge branch 'ent-8179-Mensaje-anti-hacking-al-intentar-eliminar-modulos' into 'develop'
minor fix See merge request artica/pandorafms!4562
This commit is contained in:
commit
7f78a5b514
|
@ -253,6 +253,7 @@ $module_action = (string) get_parameter('module_action');
|
||||||
if ($module_action === 'delete') {
|
if ($module_action === 'delete') {
|
||||||
$id_agent_modules_delete = (array) get_parameter('id_delete');
|
$id_agent_modules_delete = (array) get_parameter('id_delete');
|
||||||
|
|
||||||
|
$print_result_msg = true;
|
||||||
$count_correct_delete_modules = 0;
|
$count_correct_delete_modules = 0;
|
||||||
foreach ($id_agent_modules_delete as $id_agent_module_del) {
|
foreach ($id_agent_modules_delete as $id_agent_module_del) {
|
||||||
$id_grupo = (int) agents_get_agent_group($id_agente);
|
$id_grupo = (int) agents_get_agent_group($id_agente);
|
||||||
|
@ -268,12 +269,19 @@ if ($module_action === 'delete') {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($id_agent_module_del < 1) {
|
if ($id_agent_module_del < 1) {
|
||||||
db_pandora_audit(
|
if (count($id_agent_modules_delete) === 1) {
|
||||||
'HACK Attempt',
|
ui_print_error_message(
|
||||||
'Expected variable from form is not correct'
|
__('No modules selected')
|
||||||
);
|
);
|
||||||
die(__('Nice try buddy'));
|
|
||||||
exit;
|
$print_result_msg = false;
|
||||||
|
} else {
|
||||||
|
ui_print_error_message(
|
||||||
|
__('There was a problem completing the operation')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
enterprise_include_once('include/functions_config_agents.php');
|
enterprise_include_once('include/functions_config_agents.php');
|
||||||
|
@ -421,25 +429,27 @@ if ($module_action === 'delete') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$count_modules_to_delete = count($id_agent_modules_delete);
|
if ($print_result_msg === true) {
|
||||||
if ($count_correct_delete_modules == 0) {
|
$count_modules_to_delete = count($id_agent_modules_delete);
|
||||||
ui_print_error_message(
|
if ($count_correct_delete_modules == 0) {
|
||||||
sprintf(
|
|
||||||
__('There was a problem completing the operation. Applied to 0/%d modules.'),
|
|
||||||
$count_modules_to_delete
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
if ($count_correct_delete_modules == $count_modules_to_delete) {
|
|
||||||
ui_print_success_message(__('Operation finished successfully.'));
|
|
||||||
} else {
|
|
||||||
ui_print_error_message(
|
ui_print_error_message(
|
||||||
sprintf(
|
sprintf(
|
||||||
__('There was a problem completing the operation. Applied to %d/%d modules.'),
|
__('There was a problem completing the operation. Applied to 0/%d modules.'),
|
||||||
$count_correct_delete_modules,
|
|
||||||
$count_modules_to_delete
|
$count_modules_to_delete
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
if ($count_correct_delete_modules == $count_modules_to_delete) {
|
||||||
|
ui_print_success_message(__('Operation finished successfully.'));
|
||||||
|
} else {
|
||||||
|
ui_print_error_message(
|
||||||
|
sprintf(
|
||||||
|
__('There was a problem completing the operation. Applied to %d/%d modules.'),
|
||||||
|
$count_correct_delete_modules,
|
||||||
|
$count_modules_to_delete
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ($module_action === 'disable') {
|
} else if ($module_action === 'disable') {
|
||||||
|
|
Loading…
Reference in New Issue