mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-26 15:25:03 +02:00
Merge branch 'feature/1932' into develop
This commit is contained in:
commit
90c4be1b50
@ -1216,13 +1216,23 @@ function tags_checks_event_acl($id_user, $id_group, $access, $tags = array(), $c
|
|||||||
//check user without tags
|
//check user without tags
|
||||||
$sql = "SELECT id_usuario FROM tusuario_perfil
|
$sql = "SELECT id_usuario FROM tusuario_perfil
|
||||||
WHERE id_usuario = '".$config["id_user"]."' AND tags = ''
|
WHERE id_usuario = '".$config["id_user"]."' AND tags = ''
|
||||||
AND id_perfil IN (SELECT id_perfil FROM tperfil WHERE ".get_acl_column($access)."=1)";
|
AND id_perfil IN (SELECT id_perfil FROM tperfil WHERE ".get_acl_column($access)."=1)
|
||||||
|
AND id_grupo = ".$id_group;
|
||||||
$user_has_perm_without_tags = db_get_all_rows_sql ($sql);
|
$user_has_perm_without_tags = db_get_all_rows_sql ($sql);
|
||||||
|
|
||||||
if ($user_has_perm_without_tags) {
|
if ($user_has_perm_without_tags) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tags_str = '';
|
||||||
|
if (!empty($tags)) {
|
||||||
|
foreach ($tags as $tag) {
|
||||||
|
$tag_id = tags_get_id($tag);
|
||||||
|
$tags_aux[$tag_id] = $tag_id;
|
||||||
|
}
|
||||||
|
$tags_str = implode(',', $tags_aux);
|
||||||
|
}
|
||||||
|
|
||||||
$query = sprintf("SELECT tags, id_grupo
|
$query = sprintf("SELECT tags, id_grupo
|
||||||
FROM tusuario_perfil, tperfil
|
FROM tusuario_perfil, tperfil
|
||||||
WHERE tperfil.id_perfil = tusuario_perfil.id_perfil AND
|
WHERE tperfil.id_perfil = tusuario_perfil.id_perfil AND
|
||||||
@ -1250,7 +1260,7 @@ function tags_checks_event_acl($id_user, $id_group, $access, $tags = array(), $c
|
|||||||
$group_ids = implode(',', $childrens_ids);
|
$group_ids = implode(',', $childrens_ids);
|
||||||
}
|
}
|
||||||
$sql = "SELECT id_usuario FROM tusuario_perfil
|
$sql = "SELECT id_usuario FROM tusuario_perfil
|
||||||
WHERE id_usuario = '".$config["id_user"]."' AND tags = '$tags_user'
|
WHERE id_usuario = '".$config["id_user"]."' AND tags IN ('$tags_str')
|
||||||
AND id_perfil IN (SELECT id_perfil FROM tperfil WHERE ".get_acl_column($access)."=1)
|
AND id_perfil IN (SELECT id_perfil FROM tperfil WHERE ".get_acl_column($access)."=1)
|
||||||
AND id_grupo IN ($group_ids)";
|
AND id_grupo IN ($group_ids)";
|
||||||
$has_perm = db_get_value_sql ($sql);
|
$has_perm = db_get_value_sql ($sql);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user