Permalink
Browse files

MNet: fixed wrong column name in SQL cleanup code

  • Loading branch information...
1 parent ee4cd8f commit 42ae4ff29032d1b472bd9693d2404caa3ae6ac20 @mudrd8mz mudrd8mz committed Nov 26, 2010
Showing with 5 additions and 3 deletions.
  1. +5 −3 auth/mnet/auth.php
View
@@ -549,9 +549,11 @@ function update_enrolments($username, $courses) {
}
// 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() {

0 comments on commit 42ae4ff

Please sign in to comment.