When we check within a course the profile of a user who had never access that course we get a wrong 'Last access'. Instead of 'Never', the last access into the course, we get the last access into the site.
We find a solution modifying the source code in moodle/user/view.php
In the original code
if ($course->id != SITEID) {
if ($lastaccess = get_record('user_lastaccess', 'userid', $user->id, 'courseid', $course->id))
}
We add a line to take into account when the user never access the course.
if ($course->id != SITEID) {
$user->lastaccess = false;
if ($lastaccess = get_record('user_lastaccess', 'userid', $user->id, 'courseid', $course->id)) { $user->lastaccess = $lastaccess->timeaccess; }
}
We test the solution on a 1.7.2 moodle with a 8.2.4 postgres installed in a SUSE Linux Enterprise Server 10 SP1; and a 1.7.2 moodle with a 4.1.22 mysql installed in a SUSE LINUX Enterprise Server 9