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

Current Online Users will not show new users when they log in without having enrolled in a course

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Minor
    • None
    • 1.8
    • Blocks
    • None
    • MOODLE_18_STABLE

    Description

      When a user logs in, they still do not always show up in the online users block.

      I propose to deprecate the mdl_user lastaccess field and switch fully to the mdl_user_lastaccess table...even for site access. This will simplify the access updates and not cause the SQL in the online_users block to be so complex.

      I added this to my login/index.php file right after update_user_login_times();

      $access = new object;
      $access->userid = $USER->id; $access->courseid = SITEID; $access->timeaccess = time();

      if(get_record('user_lastaccess', 'userid', $USER->id, 'courseid', SITEID)){
      delete_records('user_lastaccess', 'userid', $USER->id, 'courseid', SITEID);
      insert_record('user_lastaccess', $access);
      }
      else insert_record('user_lastaccess', $access);

      I couldn't get the update_record() function to work. This change works fine with the current SQL but I'm sure it could be simplified if it didn't have to check mdl_user table.

      Attachments

        Issue Links

          Activity

            People

              dougiamas Martin Dougiamas
              syxton Matthew Davidson
              Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.