Skip to content

Commit

Permalink
mnet/enrol MDL-21459 fixed some brokenness related to DB changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Penny Leach committed Jan 28, 2010
1 parent 4ac8345 commit 30ec3ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions enrol/mnet/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ function enrol_user($user, $courseid) {
* @return bool Whether the user can login from the remote host
*/
function unenrol_user($username, $courseid) {
global $MNET_REMOTE_CLIENT;
global $MNET_REMOTE_CLIENT, $DB;

if (!$userrecord = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$MNET_REMOTE_CLIENT->id))) {
throw new mnet_exception(5014, get_string('usernotfound', 'enrol_mnet'));
Expand Down Expand Up @@ -462,7 +462,7 @@ function fetch_remote_courses($mnethostid) {
if (empty($cachedcourses[$course->remoteid])) {
$course->id = $DB->insert_record('mnet_enrol_course', $dbcourse);
} else {
$course->id = $cachedcourses[$course->remoteid]->id;
$course->id = $dbcourse->id = $cachedcourses[$course->remoteid]->id;
$cachedcourses[$course->remoteid]->seen=true;
$DB->update_record('mnet_enrol_course', $dbcourse);
}
Expand Down

0 comments on commit 30ec3ee

Please sign in to comment.