From: toyomoyo Date: Thu, 5 Oct 2006 08:54:35 +0000 (+0000) Subject: fixed a bug with user listing where user_lastaccess entries are not set, e.g. after... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1e248b442c169330b281825a03cc714e292dfc41;p=moodle.git fixed a bug with user listing where user_lastaccess entries are not set, e.g. after a resotre --- diff --git a/user/index.php b/user/index.php index 85319dcd17..e8cfef1cfd 100644 --- a/user/index.php +++ b/user/index.php @@ -325,7 +325,10 @@ //$select .= $course->enrolperiod?', s.timeend ':''; $from = "FROM {$CFG->prefix}user u INNER JOIN {$CFG->prefix}role_assignments r on u.id=r.userid LEFT OUTER JOIN - {$CFG->prefix}user_lastaccess ul on r.userid=ul.userid "; + {$CFG->prefix}user_lastaccess ul on (r.userid=ul.userid and ul.courseid = $course->id)"; + // join on 2 conditions + // otherwise we run into the problem of having records in ul table, but not relevant course + // and user record is not pulled out $where = "WHERE (r.contextid = $context->id OR r.contextid in $listofcontexts) AND u.deleted = 0 $selectrole AND (ul.courseid = $course->id OR ul.courseid IS NULL)