mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Merge branch 'develop' of https://github.com/pandorafms/pandorafms into develop
This commit is contained in:
commit
717d32ecca
@ -889,6 +889,8 @@ function tags_has_user_acl_tags($id_user = false) {
|
|||||||
function tags_get_user_tags($id_user = false, $access = 'AR') {
|
function tags_get_user_tags($id_user = false, $access = 'AR') {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
//users_is_strict_acl
|
||||||
|
|
||||||
if ($id_user === false) {
|
if ($id_user === false) {
|
||||||
$id_user = $config['id_user'];
|
$id_user = $config['id_user'];
|
||||||
}
|
}
|
||||||
@ -900,22 +902,36 @@ function tags_get_user_tags($id_user = false, $access = 'AR') {
|
|||||||
// tags restrictions, the user can see all tags
|
// tags restrictions, the user can see all tags
|
||||||
$acl_column = get_acl_column($access);
|
$acl_column = get_acl_column($access);
|
||||||
|
|
||||||
if(empty($acl_column)) {
|
if (empty($acl_column)) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = sprintf("SELECT count(*)
|
$query = sprintf("
|
||||||
|
SELECT count(*)
|
||||||
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
|
||||||
tusuario_perfil.id_usuario = '%s' AND
|
AND tusuario_perfil.id_usuario = '%s'
|
||||||
tperfil.%s = 1 AND tags <> ''",
|
AND tperfil.%s = 1
|
||||||
|
AND tags <> ''",
|
||||||
$id_user, $acl_column);
|
$id_user, $acl_column);
|
||||||
|
|
||||||
$profiles_without_tags = db_get_value_sql($query);
|
$profiles_without_tags = db_get_value_sql($query);
|
||||||
|
|
||||||
if ($profiles_without_tags == 0) {
|
if ($profiles_without_tags == 0) {
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
// FIXED FOR TICKET #1921
|
||||||
|
//
|
||||||
|
// If the user is setted with strict ACL, the pandora does not
|
||||||
|
// show any tags. Thanks Mr. C from T.
|
||||||
|
//
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
if (users_is_strict_acl($id_user)) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
else {
|
||||||
return $all_tags;
|
return $all_tags;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get the tags of the required access flag for each group
|
// Get the tags of the required access flag for each group
|
||||||
$tags = tags_get_acl_tags($id_user, 0, $access, 'data');
|
$tags = tags_get_acl_tags($id_user, 0, $access, 'data');
|
||||||
@ -928,7 +944,7 @@ function tags_get_user_tags($id_user = false, $access = 'AR') {
|
|||||||
$user_tags_id = array();
|
$user_tags_id = array();
|
||||||
|
|
||||||
foreach ($tags as $t) {
|
foreach ($tags as $t) {
|
||||||
if(empty($user_tags_id)) {
|
if (empty($user_tags_id)) {
|
||||||
$user_tags_id = $t;
|
$user_tags_id = $t;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -21,6 +21,22 @@
|
|||||||
|
|
||||||
require_once($config['homedir'] . "/include/functions_groups.php");
|
require_once($config['homedir'] . "/include/functions_groups.php");
|
||||||
|
|
||||||
|
function users_is_strict_acl($id_user = null) {
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
if (empty($id_user)) {
|
||||||
|
$id_user = $config['id_user'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$strict_acl = (bool)db_get_value('strict_acl', 'tusuario',
|
||||||
|
'id_user', $id_user);
|
||||||
|
|
||||||
|
html_debug_print($strict_acl, true);
|
||||||
|
html_debug_print($id_user, true);
|
||||||
|
|
||||||
|
return $strict_acl;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a list of all users in an array [username] => (info)
|
* Get a list of all users in an array [username] => (info)
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user