Moodle

Online Users block not showing online users!

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.7
  • Fix Version/s: 1.7, 1.8.1
  • Component/s: Blocks
  • Labels:
    None
  • Environment:
    Win 2K3, MySQL 5.0, PHP 5.1.6

Description

After doing some relevent bug testing in 1.7, I have just realised that online users list is not working.

A) I cannot see myself (Who is logged in)
B) I cannot see anyone else who is logged in also.

All I see is the standard 5mins refresh and just the block, as if no one is online.

Thanks Guys,

Josh Coombs

  1. online users.jpg
    126 kB
    15/Sep/06 1:22 AM
  2. screenshot-3.jpg
    295 kB
    17/May/07 12:59 AM
  3. screenshot-4.jpg
    330 kB
    17/May/07 12:59 AM

Issue Links

Activity

Hide
Martin Dougiamas added a comment -

Fixed some time ago.

Show
Martin Dougiamas added a comment - Fixed some time ago.
Hide
Matt Campbell added a comment -

Verified - working properly in Moodle 1.7 dev (2006092600)

Show
Matt Campbell added a comment - Verified - working properly in Moodle 1.7 dev (2006092600)
Hide
Josh Coombs added a comment -

Unfortunetly, It has not been fixed, as I have done a fresh install of it and the problem is replicating yet again... I also have 1.6.1+ on same server running beatifully as expected. So this must be a coding issue.

Many Thanks,

Josh

Show
Josh Coombs added a comment - Unfortunetly, It has not been fixed, as I have done a fresh install of it and the problem is replicating yet again... I also have 1.6.1+ on same server running beatifully as expected. So this must be a coding issue. Many Thanks, Josh
Hide
Matt Campbell added a comment -

Could you post some details? What version of 1.7 dev are you using? What platform, database, etc?

Show
Matt Campbell added a comment - Could you post some details? What version of 1.7 dev are you using? What platform, database, etc?
Hide
Petr Škoda (skodak) added a comment -

works fine for me...

Show
Petr Škoda (skodak) added a comment - works fine for me...
Hide
Matt Campbell added a comment -

Need further information regarding server environment. Working fine on many other installs.

Show
Matt Campbell added a comment - Need further information regarding server environment. Working fine on many other installs.
Hide
Ken Wilson added a comment -

Tested with W2K3 R2, MySQL 5.0.24, PHP 5.1.6, Apache 2.2. Confirmed as OK, with Moodle 1.7beta. Could be an IIS problem - check in the forums for similar.

Show
Ken Wilson added a comment - Tested with W2K3 R2, MySQL 5.0.24, PHP 5.1.6, Apache 2.2. Confirmed as OK, with Moodle 1.7beta. Could be an IIS problem - check in the forums for similar.
Hide
Richard Ackland added a comment -

This is definately a problem for me....

W2K3 R2, MySQL 5.0.24, PHP 5.1.6, IIS 5.0

I am also having issues with users not being able to see upcoming events

Show
Richard Ackland added a comment - This is definately a problem for me.... W2K3 R2, MySQL 5.0.24, PHP 5.1.6, IIS 5.0 I am also having issues with users not being able to see upcoming events
Hide
Ken Wilson added a comment -

Richard - Can you please confirm that mysql strict mode is OFF by running

mysql> SHOW VARIABLES LIKE '%mode%';

Also note that PHP 5.1.2 is unofficially recommended for W2K3 R2 - others tend to give problems.
What browser are you using? Can you attach the output from your phpinfo when run from your browser.
Thanks!

Show
Ken Wilson added a comment - Richard - Can you please confirm that mysql strict mode is OFF by running mysql> SHOW VARIABLES LIKE '%mode%'; Also note that PHP 5.1.2 is unofficially recommended for W2K3 R2 - others tend to give problems. What browser are you using? Can you attach the output from your phpinfo when run from your browser. Thanks!
Hide
Richard Ackland added a comment -

Hi,

I fixed usign the solution posted in MDL-7581

Fix for block_online_users.php
Fixes the error where not all on line users are displayed.
replace line 76

from

if ($pusers = get_records_sql($SQL, 0, 20)) {

to

if ($pusers = get_records_sql($SQL, 0)) {

my actual settings for the server I am runing are as follows, took them from a development server above - sorry....

Windows 2003 Server with IIS 5.0
unicode is recommended to be installed/enabled OK
database mysql version 4.1.16 is required and you are running 4.1.18 OK
php version 4.3.0 is required and you are running 5.1.2 OK
php_extension iconv is recommended to be installed/enabled OK
php_extension mbstring is recommended to be installed/enabled OK,

Show
Richard Ackland added a comment - Hi, I fixed usign the solution posted in MDL-7581 Fix for block_online_users.php Fixes the error where not all on line users are displayed. replace line 76 from if ($pusers = get_records_sql($SQL, 0, 20)) { to if ($pusers = get_records_sql($SQL, 0)) { my actual settings for the server I am runing are as follows, took them from a development server above - sorry.... Windows 2003 Server with IIS 5.0 unicode is recommended to be installed/enabled OK database mysql version 4.1.16 is required and you are running 4.1.18 OK php version 4.3.0 is required and you are running 5.1.2 OK php_extension iconv is recommended to be installed/enabled OK php_extension mbstring is recommended to be installed/enabled OK,
Hide
Matthew Davidson added a comment -

would changing
$groupselect ";
to
$groupselect GROUP BY u.id";
also help eliminate redundant returns?

Show
Matthew Davidson added a comment - would changing $groupselect "; to $groupselect GROUP BY u.id"; also help eliminate redundant returns?
Hide
Martin Dougiamas added a comment -

I've increased the course to 50, and added some rounding to the times to help query caching (gives slight speed increases).

Show
Martin Dougiamas added a comment - I've increased the course to 50, and added some rounding to the times to help query caching (gives slight speed increases).
Hide
Gustavo Augusto Hennig added a comment -

There are an error in this SQL:

$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";

The group by isn't needed here, there are no efect.
I think this line can be removed:

$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";

Show
Gustavo Augusto Hennig added a comment - There are an error in this SQL: $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"; The group by isn't needed here, there are no efect. I think this line can be removed: $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";
Hide
Matthew Davidson added a comment - - edited

Can somebody please delete screenshots 2 and 3.

Thanks

Show
Matthew Davidson added a comment - - edited Can somebody please delete screenshots 2 and 3. Thanks
Hide
Matthew Davidson added a comment -

This is the SQL without the Group By u.id.

Notice there 245 records return....of these, we know by the previous screenshot that there are only 3 unique users....but according to the script, it will only print the first 20 members. If there isn't an instance of 1 of those members in the top 20 returned records, they will not show online, even though they have been active lately.

Show
Matthew Davidson added a comment - This is the SQL without the Group By u.id. Notice there 245 records return....of these, we know by the previous screenshot that there are only 3 unique users....but according to the script, it will only print the first 20 members. If there isn't an instance of 1 of those members in the top 20 returned records, they will not show online, even though they have been active lately.

Dates

  • Created:
    Updated:
    Resolved: