]> git.mjollnir.org Git - moodle.git/commitdiff
lib/setup: declare SYSCONTEXTID to have the system context handy
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:02:18 +0000 (07:02 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:02:18 +0000 (07:02 +0000)
lib/setup.php

index a0ded0af2d088aeaffec7a7f593d1f596ceb2499..3558e98c1aa07dc8c1fdcd9acb9f1457abae0fca 100644 (file)
@@ -249,6 +249,13 @@ global $HTTPSPAGEREQUIRED;
         $COURSE->id = 1;
     }
 
+    $sysctxid = get_field('context', 'id',
+                          'contextlevel', CONTEXT_SYSTEM);
+if (!empty($syscontextid)) {
+        define('SYSCONTEXTID', $syscontextid);
+    } else {
+        define('SYSCONTEXTID', 1);
+    }
 
 /// Set error reporting back to normal
     if ($originaldatabasedebug == -1) {