From ba572e34597995fdc5fb4adcc6274b9395c4ea2b Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Thu, 11 Nov 2010 00:46:33 +0000 Subject: [PATCH] MDL-25145 ignore bogus roles of deleted users in meta enrol sync --- enrol/meta/locallib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/enrol/meta/locallib.php b/enrol/meta/locallib.php index 9599bb192f54e..2cd0870287584 100644 --- a/enrol/meta/locallib.php +++ b/enrol/meta/locallib.php @@ -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)