]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed the definition of SYSCONTEXTID when it's not 1 (like moodle.org)
authormoodler <moodler>
Fri, 21 Sep 2007 04:55:14 +0000 (04:55 +0000)
committermoodler <moodler>
Fri, 21 Sep 2007 04:55:14 +0000 (04:55 +0000)
lib/setup.php

index 46655ce3cfc13a9ec6e018f6a55f984c82487073..53ce9e4b59f4770eee8ecc6acd80c9b43d9ada27 100644 (file)
@@ -231,7 +231,7 @@ global $HTTPSPAGEREQUIRED;
         register_shutdown_function('moodle_request_shutdown');
     }
 
-//// Defining the site
+/// Defining the site
     if ($SITE = get_site()) {
         /**
          * If $SITE global from {@link get_site()} is set then SITEID to $SITE->id, otherwise set to 1.
@@ -249,10 +249,8 @@ global $HTTPSPAGEREQUIRED;
         $COURSE->id = 1;
     }
 
-    $sysctxid = get_field('context', 'id',
-                          'contextlevel', CONTEXT_SYSTEM);
-if (!empty($syscontextid)) {
-        define('SYSCONTEXTID', $syscontextid);
+    if ($sysctxid = get_field('context', 'id', 'contextlevel', CONTEXT_SYSTEM)) {
+        define('SYSCONTEXTID', $sysctxid);
     } else {
         define('SYSCONTEXTID', 1);
     }