diff --git a/modules/user/user.module b/modules/user/user.module index d7e5ad56b266e00596d7720c4af5f6bef3ecb11b..c4d52b08129dbe68b70052e791612f4dbb3e5853 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -585,7 +585,7 @@ function user_block($op = 'list', $delta = 0, $edit = array()) { // Perform database queries to gather online user lists. We use s.timestamp // rather than u.access because it is much faster is much faster.. $anonymous_count = sess_count($interval); - $authenticated_users = db_query('SELECT u.uid, u.name FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.timestamp >= %d AND s.uid > 0 ORDER BY s.timestamp DESC', $interval); + $authenticated_users = db_query('SELECT DISTINCT u.uid, u.name FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.timestamp >= %d AND s.uid > 0 ORDER BY s.timestamp DESC', $interval); $authenticated_count = db_num_rows($authenticated_users); // Format the output with proper grammar.