Commit aae03395 authored by Dries's avatar Dries

- Patch #107051 by webchick: duplicate user names in who is online block

parent d6e62eea
...@@ -585,7 +585,7 @@ function user_block($op = 'list', $delta = 0, $edit = array()) { ...@@ -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 // Perform database queries to gather online user lists. We use s.timestamp
// rather than u.access because it is much faster is much faster.. // rather than u.access because it is much faster is much faster..
$anonymous_count = sess_count($interval); $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); $authenticated_count = db_num_rows($authenticated_users);
// Format the output with proper grammar. // Format the output with proper grammar.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment