Browse files

MDL-17539 - Added a 'courseid' condition to the 'LEFT JOIN' of 'lasta…

…ccess' to limit the records returned to the correctly requested course.
  • Loading branch information...
1 parent 7f2e6a2 commit 13c223cb2f00f267cde710269f7ae3b84d8277f8 mchurch committed Dec 5, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/deprecatedlib.php
@@ -682,7 +682,7 @@ function get_course_students($courseid, $sort='ul.timeaccess', $dir='', $page=''
{$CFG->prefix}role_assignments ra on INNER JOIN
{$CFG->prefix}role_capabilities rc ON ra.roleid=rc.roleid INNER JOIN
{$CFG->prefix}context c ON LEFT OUTER JOIN
- {$CFG->prefix}user_lastaccess ul on ul.userid=ra.userid
+ {$CFG->prefix}user_lastaccess ul on ul.userid=ra.userid AND ul.courseid = $courseid
WHERE $select $search $sort $dir", $page, $recordsperpage);

0 comments on commit 13c223c

Please sign in to comment.