diff --git a/core/users/users.php b/core/users/users.php index 9e7477a0a0..aa227d427a 100644 --- a/core/users/users.php +++ b/core/users/users.php @@ -81,6 +81,20 @@ echo " \n"; //get the list of superadmins $superadmins = superadmin_list($db); +//get the users' group(s) from the database + $sql = "select * from v_group_users "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "order by group_name asc "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); + if (count($result) > 0) { + foreach($result as $row) { + $user_groups[$row['user_uuid']][] = $row['group_name']; + } + } + unset ($sql, $prep_statement); + //get the users from the database $sql = "select count(*) as num_rows from v_users "; $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; @@ -136,6 +150,7 @@ echo " \n"; echo "\n"; echo th_order_by('username', $text['label-username'], $order_by, $order); + echo "".$text['label-groups']."\n"; echo "".$text['label-enabled']."\n"; echo ""; if (permission_exists('user_add')) { @@ -160,6 +175,11 @@ echo " \n"; } echo " \n"; echo " "; + if (sizeof($user_groups[$row['user_uuid']]) > 0) { + echo implode(', ', $user_groups[$row['user_uuid']]); + } + echo " \n"; + echo " "; if ($row['user_enabled'] == 'true') { echo $text['option-true']; }