-
Bug
-
Resolution: Deferred
-
Minor
-
None
-
3.9.11, 4.0.7
-
MOODLE_39_STABLE, MOODLE_400_STABLE
The Log in As feature is great, and the fact that the Moodle logs record this information (who logged in as whom and what they did while logged in) is fantastic. The only bug I see is when that user clicks "Log out" to stop impersonating the other user – the "User logged out" event shows the impersonated user instead of mimicking the previous log entries.
In the logs, I expect to see "TeacherA as StudentB" – User Logged out
Instead, I see "StudentB" - User Logged out
I don't think it should be possible to have "log out" log entries when there are no "log in" log entries, though I don't see any "TeacherA logged in as StudentB" entry either. Otherwise, it makes it appear that the user was "in the system" when in actuality it was someone logged in as them using the "Log in As" feature who then logged out.
Steps to Reproduc in Moodle 4.1:
Part 1:
- Log in to Moodle as a Moodle Administrator, example: Terri Admin.
- Immediately log out of Moodle.
- Lock back to Moodle as the same Moodle Administrator, example: Terri Admin.
- Go to your profile and click Today's Logs
- Verify there are two log entries: "User has logged in" followed by "User has logged out" (there may be a "Course Viewed" entry in between).
- Verify both log entries have "Terri Admin" listed in the User full name column.
Part 2:
- While still logged in as a Moodle Administrator, example: Terri Admin; go to any course's "Participants" page
- Click on the name of a student from the Enrolled Users list, example: Sam Student.
- Click the "Log in as" link on the student's profile.
- Verify the message "You are logged in as 'Sam Student'" appears, and click continue.
- Immediately log out of Moodle.
Part 3:
- Log in to Moodle as a Moodle Administrator, example: Terri Admin.
- Go to the Moodle Front Page
- Click "Site Administration" - "Reports" - "Logs" (DO NOT DO THIS FROM WITHIN COURSE LOGS as they will filter out site events)
- Select "Same Student" and "Today" from the dropdown menus and click "Get these logs".
- Verify there are two log entries: "User has logged in" followed by "User has logged out" (there may be a "Course Viewed" entry in between).
- Expectation: both entries would have "Admin User as Same Student" listed in the User full name column, just as it is for the "Course Viewed" entry.
- Actual: It it logged that "Sam Student" has performed the "Log in" and "Log out" actions (note that the IP address is indeed different).
After thinking about this deeper, it does make sense that I would have to go to the Logs of "Terri Admin" to see "User logged in as another user".... but, what I don't see there is "User logged out as another user" – instead that log out appears on the "Students" profile as if the student did this action (again, it at least does show a different IP address)...
This issue tends to come up when we tell families that their child hasn't been logging into school, so when they look at their child's logs, they can be a little misleading at times when we have a case of someone using the Log in As Feature (we do try to tell the parents about using the IP address column, but some of them aren't as tech savvy, just as we tell them about the Origin column to see if the log entry is 'web' based versus 'cli'). Just wondering if it's possible to somehow indicate the log out was not a direct student action log.