From: moodler Date: Sat, 25 Sep 2004 15:33:06 +0000 (+0000) Subject: Merged change to restore $CFG->prefix from stable X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ea8dedc8825748010da2e040815977b84ef977b4;p=moodle.git Merged change to restore $CFG->prefix from stable --- diff --git a/enrol/database/enrol.php b/enrol/database/enrol.php index 13452dc5ce..5ab891c436 100644 --- a/enrol/database/enrol.php +++ b/enrol/database/enrol.php @@ -26,6 +26,7 @@ function get_student_courses(&$user) { // The following hack will make the database explicit which keeps it happy if (strpos($CFG->prefix, $CFG->dbname) === false) { + $oldprefix = $CFG->prefix; $CFG->prefix = "$CFG->dbname.$CFG->prefix"; } @@ -77,6 +78,10 @@ function get_student_courses(&$user) { $enroldb->Close(); } + + if (!empty($oldprefix)) { + $CFG->prefix = $oldprefix; // Restore it just in case + } }