Skip to content

Commit

Permalink
MDL-25145 ignore bogus roles of deleted users in meta enrol sync
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Nov 11, 2010
1 parent 18eaadf commit ba572e3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions enrol/meta/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ function enrol_meta_sync($courseid = NULL) {
list($enabled, $params) = $DB->get_in_or_equal($enabled, SQL_PARAMS_NAMED, 'e00');
$sql = "SELECT DISTINCT pra.roleid, pra.userid, c.id AS contextid, e.id AS enrolid
FROM {role_assignments} pra
JOIN {user} u ON (u.id = pra.userid AND u.deleted = 0)
JOIN {context} pc ON (pc.id = pra.contextid AND pc.contextlevel = :coursecontext AND pra.component $enabled)
JOIN {enrol} e ON (e.customint1 = pc.instanceid AND e.enrol = 'meta' AND e.status = :statusenabled $onecourse)
JOIN {context} c ON (c.contextlevel = pc.contextlevel AND c.instanceid = e.courseid)
Expand Down

0 comments on commit ba572e3

Please sign in to comment.