Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
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.
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