Moodle

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

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: 1.8
  • Fix Version/s: None
  • Component/s: Blocks
  • Labels:
    None
  • Affected Branches:
    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.

Issue Links

Activity

Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Michael de Raadt added a comment -

I'm closing this issue as it has become inactive and does not appear to affect a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it has become inactive and does not appear to affect a current supported version. If you are encountering this problem or one similar, please launch a new issue.

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: