Fixed blocked group in group_list

This commit is contained in:
danielmaya 2018-01-04 16:34:40 +01:00
parent 2ad1fe7d79
commit 43ec1cb7f4
2 changed files with 14 additions and 9 deletions

View File

@ -334,7 +334,13 @@ if (($delete_group) && (check_acl($config['id_user'], 0, "PM"))) {
}
}
db_clean_cache();
$groups = users_get_groups_tree ($config['id_user'], "AR", true);
if ($create_group || $delete_group || $update_group) {
$groups = users_get_groups ($config['id_user'], "AR", true, true, null, 'id_grupo', false);
$groups = groups_get_groups_tree_recursive($groups);
} else {
$groups = users_get_groups_tree ($config['id_user'], "AR", true);
}
$table->width = '100%';
@ -342,7 +348,7 @@ $all_parents = array();
$groups_count = 0;
$sons = array();
$groups_count = count($groups);
foreach ($groups as $k => $g) {
if ($g['parent'] != 0) {
@ -360,8 +366,6 @@ foreach ($all_parents as $parent) {
}
$groups_count = count($groups);
if (!empty($groups)) {
$table->class = "databox data";
$table->head = array ();

View File

@ -151,7 +151,8 @@ function users_get_groups_for_select($id_user, $privilege = "AR", $returnAllGro
*
* @return array A list of the groups the user has certain privileges.
*/
function users_get_groups ($id_user = false, $privilege = "AR", $returnAllGroup = true, $returnAllColumns = false, $id_groups = null, $keys_field = 'id_grupo') {
function users_get_groups ($id_user = false, $privilege = "AR", $returnAllGroup = true, $returnAllColumns = false,
$id_groups = null, $keys_field = 'id_grupo', $cache = true) {
static $group_cache = array();
if (empty ($id_user)) {
@ -164,7 +165,7 @@ function users_get_groups ($id_user = false, $privilege = "AR", $returnAllGroup
}
// Check the group cache first.
if (array_key_exists($id_user, $group_cache)) {
if (array_key_exists($id_user, $group_cache) && $cache) {
$groups = $group_cache[$id_user];
} else {
// Admin.