]> git.mjollnir.org Git - moodle.git/commitdiff
Merged change to restore $CFG->prefix from stable
authormoodler <moodler>
Sat, 25 Sep 2004 15:33:06 +0000 (15:33 +0000)
committermoodler <moodler>
Sat, 25 Sep 2004 15:33:06 +0000 (15:33 +0000)
enrol/database/enrol.php

index 13452dc5ce471a38bec80c49daeef8623b10e1a2..5ab891c436013613df4f1d4b622a6a3f51ef4ffb 100644 (file)
@@ -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
+    }
 }