When a user logs in, it doesn't always show them in the online users block. Sometimes they have to enter a course to finally show up on the site online users block. I tested my system by logging in 20 test users, and I was only getting 9 of them to show up. After making the following code change, the users seem to all be there.
$SQL = "SELECT u.id, u.username, u.firstname, u.lastname, u.picture, u.lastaccess, ul.timeaccess
FROM {$CFG->prefix}user_lastaccess ul,
{$CFG->prefix}user u
$groupmembers
WHERE
ul.userid = u.id
$courseselect
$timeselect
$groupselect
ORDER BY ul.timeaccess DESC";
to
$SQL = "SELECT u.id, u.username, u.firstname, u.lastname, u.picture, u.lastaccess, ul.timeaccess
FROM {$CFG->prefix}user_lastaccess ul,
{$CFG->prefix}user u
$groupmembers
WHERE
ul.userid = u.id
$courseselect
$timeselect
$groupselect
GROUP BY u.id
ORDER BY ul.timeaccess DESC";
- is blocked by
-
MDL-9662 Current Online Users will not show new users when they log in without having enrolled in a course
- Closed
-
MDL-10936 Online Users block not updating
- Closed
- will be (partly) resolved by
-
MDL-9662 Current Online Users will not show new users when they log in without having enrolled in a course
- Closed