From: David Mudrak Date: Fri, 26 Nov 2010 09:20:16 +0000 (+0000) Subject: MNet: fixed wrong column name in SQL cleanup code X-Git-Tag: v2.0.1~159 X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=commitdiff_plain;h=42ae4ff29032d1b472bd9693d2404caa3ae6ac20;ds=sidebyside MNet: fixed wrong column name in SQL cleanup code --- diff --git a/auth/mnet/auth.php b/auth/mnet/auth.php index 84bbbbc9df2..4008d3858df 100644 --- a/auth/mnet/auth.php +++ b/auth/mnet/auth.php @@ -549,9 +549,11 @@ class auth_plugin_mnet extends auth_plugin_base { } // Clean up courses that the user is no longer enrolled in. - $local_courseid_string = implode(', ', $local_courseid_array); - $whereclause = " userid = ? AND hostid = ? AND courseid NOT IN ($local_courseid_string)"; - $DB->delete_records_select('mnetservice_enrol_enrolments', $whereclause, array($userid, $remoteclient->id)); + if (!empty($local_courseid_array)) { + $local_courseid_string = implode(', ', $local_courseid_array); + $whereclause = " userid = ? AND hostid = ? AND remotecourseid NOT IN ($local_courseid_string)"; + $DB->delete_records_select('mnetservice_enrol_enrolments', $whereclause, array($userid, $remoteclient->id)); + } } function prevent_local_passwords() {