Merge branch 'ent-8215-perfiles-usuario-puede-crear-agentes-de-otros-grupos' into 'develop'

Fix ACL grous AW creation

See merge request artica/pandorafms!4523
This commit is contained in:
Daniel Rodriguez 2021-11-16 17:03:17 +00:00
commit 38468ff1f2
2 changed files with 8 additions and 0 deletions

View File

@ -341,6 +341,7 @@ if (isset($groups[$grupo]) || $new_agent) {
'selected' => $grupo, 'selected' => $grupo,
'return' => true, 'return' => true,
'required' => true, 'required' => true,
'privilege' => 'AW',
] ]
); );
} else { } else {

View File

@ -196,6 +196,13 @@ if ($create_agent) {
$nombre_agente = hash('sha256', $alias.'|'.$direccion_agente.'|'.time().'|'.sprintf('%04d', rand(0, 10000))); $nombre_agente = hash('sha256', $alias.'|'.$direccion_agente.'|'.time().'|'.sprintf('%04d', rand(0, 10000)));
$grupo = (int) get_parameter_post('grupo'); $grupo = (int) get_parameter_post('grupo');
if ((bool) check_acl($config['id_user'], $grupo, 'AW') === false) {
db_pandora_audit('ACL Violation', 'Trying to access agent manager');
include $config['homedir'].'/general/noaccess.php';
return;
}
$intervalo = (string) get_parameter_post('intervalo', SECONDS_5MINUTES); $intervalo = (string) get_parameter_post('intervalo', SECONDS_5MINUTES);
$comentarios = (string) get_parameter_post('comentarios', ''); $comentarios = (string) get_parameter_post('comentarios', '');
$modo = (int) get_parameter_post('modo'); $modo = (int) get_parameter_post('modo');