[Secondary groups] Fixed modules edition problems

This commit is contained in:
fermin831 2018-08-16 14:55:48 +02:00
parent 9433c9ddd1
commit df46772733
2 changed files with 6 additions and 6 deletions

View File

@ -986,16 +986,16 @@ $edit_module = (bool) get_parameter ('edit_module');
// GET DATA for MODULE UPDATE OR MODULE INSERT
if ($update_module || $create_module) {
$id_grupo = agents_get_agent_group ($id_agente);
$all_groups = agents_get_all_groups_agent ($id_agente, $id_grupo);
$id_agent_module = (int) get_parameter ('id_agent_module');
if (!check_acl ($config["id_user"], $id_grupo, "AW")) {
if (! check_acl_one_of_groups ($config["id_user"], $all_groups, "AW")) {
db_pandora_audit("ACL Violation",
"Trying to create a module without admin rights");
require ("general/noaccess.php");
exit;
}
$id_agent_module = (int) get_parameter ('id_agent_module');
$id_module_type = (int) get_parameter ('id_module_type');
$name = (string) get_parameter ('name');
$description = (string) get_parameter ('description');

View File

@ -656,7 +656,7 @@ foreach ($modules as $module) {
"alt" => "")) . " ";
}
if (check_acl ($config['id_user'], $agent['id_grupo'], "AW")) {
if (check_acl_one_of_groups ($config["id_user"], $all_groups, "AW")) {
$data[0] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=' . $id_agente . '&tab=module&edit_module=1&id_agent_module='.$module['id_agente_modulo'].'">';
}
@ -668,7 +668,7 @@ foreach ($modules as $module) {
$data[0] .= ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '[&hellip;]', 'font-size: 7.2pt');
}
if (check_acl ($config['id_user'], $agent['id_grupo'], "AW")) {
if (check_acl_one_of_groups ($config["id_user"], $all_groups, "AW")) {
$data[0] .= '</a>';
}