diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 66aeec8bc8..39aa94d336 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -11199,7 +11199,7 @@ function reporting_get_stats_users($data) $users = get_users('', ['disabled' => 0], ['id_user', 'is_admin']); } else { foreach ($group_um as $group => $value) { - $users = array_merge($users, users_get_users_by_group($group, $value)); + $users = array_merge($users, users_get_users_by_group($group, $value, false)); } } } diff --git a/pandora_console/include/functions_users.php b/pandora_console/include/functions_users.php index a0cac33b30..ef1e54576e 100755 --- a/pandora_console/include/functions_users.php +++ b/pandora_console/include/functions_users.php @@ -778,9 +778,10 @@ function users_get_groups_UM($id_user) * Obtiene una matriz con los grupos como clave y si tiene o no permiso UM sobre ese grupo(valor) * * @param string User id + * @param boolean $disabled Return also disabled users * @return array Return . */ -function users_get_users_by_group($id_group, $um=false) +function users_get_users_by_group($id_group, $um=false, $disabled=true) { $sql = sprintf( "SELECT tusuario.* FROM tusuario @@ -789,6 +790,10 @@ function users_get_users_by_group($id_group, $um=false) $id_group ); + if ($disabled === false) { + $sql .= 'WHERE tusuario.disabled = 0'; + } + $users = db_get_all_rows_sql($sql); $return = []; foreach ($users as $key => $user) {