Skip to content
Browse files

MDL-26568 block_online_users - reporting incorrect number of users

When over 50 users were online the count used in the listing was incorrect
  • Loading branch information...
1 parent 462a064 commit 10aeaf0f74b080e7ad6523fb44321d48aa1e9c1f @danpoltawski danpoltawski committed with stronk7 Aug 3, 2011
Showing with 4 additions and 6 deletions.
  1. +4 −6 blocks/online_users/block_online_users.php
View
10 blocks/online_users/block_online_users.php
@@ -62,11 +62,10 @@ function get_content() {
GROUP BY $userfields
ORDER BY lastaccess DESC ";
- $csql = "SELECT COUNT(u.id), u.id
+ $csql = "SELECT COUNT(u.id)
FROM {user} u $groupmembers
WHERE u.lastaccess > $timefrom
- $groupselect
- GROUP BY u.id";
+ $groupselect";
} else {
// Course level - show only enrolled users for now
@@ -85,14 +84,13 @@ function get_content() {
GROUP BY $userfields
ORDER BY lastaccess DESC";
- $csql = "SELECT u.id
+ $csql = "SELECT COUNT(u.id)
FROM {user_lastaccess} ul $groupmembers, {user} u
JOIN ($esqljoin) euj ON euj.id = u.id
WHERE ul.timeaccess > $timefrom
AND u.id = ul.userid
AND ul.courseid = :courseid
- $groupselect
- GROUP BY u.id";
+ $groupselect";
$params['courseid'] = $this->page->course->id;
}

0 comments on commit 10aeaf0

Please sign in to comment.
Something went wrong with that request. Please try again.