Now the section applies the module ACL properly

This commit is contained in:
Alejandro Gallardo Escobar 2015-10-01 16:18:45 +02:00
parent 38d32af163
commit 565744c176
1 changed files with 16 additions and 18 deletions

View File

@ -232,30 +232,28 @@ if ($tag_filter !== 0) {
// Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!) // Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!)
$groups = users_get_groups($config["id_user"]); $groups = users_get_groups($config["id_user"]);
if ($ag_group !== 0) { // Apply the module ACL with tags
$sql_conditions_tags = tags_get_acl_tags($config['id_user'], $sql_conditions_tags = '';
$ag_group, 'AR', 'module_condition', 'AND', 'tagente_modulo', if (!users_is_admin()) {
true, array(), true); if ($ag_group !== 0) {
} else { $sql_conditions_tags = tags_get_acl_tags($config['id_user'],
$sql_conditions_tags = tags_get_acl_tags( $ag_group, 'AR', 'module_condition', 'AND', 'tagente_modulo',
$config['id_user'], array_keys($groups), 'AR', true, array(), true);
'module_condition', 'AND', 'tagente_modulo', true, array(), } else {
true); $sql_conditions_tags = tags_get_acl_tags(
} $config['id_user'], array_keys($groups), 'AR',
'module_condition', 'AND', 'tagente_modulo', true, array(),
if (is_numeric($sql_conditions_tags)) { true);
$sql_conditions_tags = ' AND 1 = 0'; }
if (is_numeric($sql_conditions_tags)) {
$sql_conditions_tags = ' AND 1 = 0';
}
} }
// Two modes of filter. All the filters and only ACLs filter // Two modes of filter. All the filters and only ACLs filter
$sql_conditions_all = $sql_conditions_base . $sql_conditions . $sql_conditions_group . $sql_conditions_tags . $sql_conditions_custom_fields; $sql_conditions_all = $sql_conditions_base . $sql_conditions . $sql_conditions_group . $sql_conditions_tags . $sql_conditions_custom_fields;
$sql_conditions_acl = $sql_conditions_base . $sql_conditions_group . $sql_conditions_tags . $sql_conditions_custom_fields; $sql_conditions_acl = $sql_conditions_base . $sql_conditions_group . $sql_conditions_tags . $sql_conditions_custom_fields;
if (!$strict_user) {
$sql_conditions_all = $sql_conditions_base . $sql_conditions . $sql_conditions_group . $sql_conditions_custom_fields;
$sql_conditions_acl = $sql_conditions_base . $sql_conditions_group . $sql_conditions_custom_fields;
}
// Get count to paginate // Get count to paginate
if (!defined('METACONSOLE')) if (!defined('METACONSOLE'))
$count = db_get_sql ("SELECT COUNT(tagente_modulo.id_agente_modulo) " . $sql_from . $sql_conditions_all); $count = db_get_sql ("SELECT COUNT(tagente_modulo.id_agente_modulo) " . $sql_from . $sql_conditions_all);