Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-9613

Online Users Block (with partial fix)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8.3
    • Component/s: Blocks
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE

      Description

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

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Oct/07