]> git.mjollnir.org Git - moodle.git/commitdiff
merged, making the site context and site course context the same
authortoyomoyo <toyomoyo>
Thu, 19 Oct 2006 06:16:35 +0000 (06:16 +0000)
committertoyomoyo <toyomoyo>
Thu, 19 Oct 2006 06:16:35 +0000 (06:16 +0000)
lib/accesslib.php

index 637e9338576af1d480e90bbd010711d4675e1ebf..132cda8af2afb03672521a0c42ddaec415be098c 100755 (executable)
@@ -1268,6 +1268,11 @@ function get_context_instance($contextlevel=NULL, $instance=SITEID) {
     global $context_cache, $context_cache_id, $CONTEXT;
     static $allowed_contexts = array(CONTEXT_SYSTEM, CONTEXT_PERSONAL, CONTEXT_USER, CONTEXT_COURSECAT, CONTEXT_COURSE, CONTEXT_GROUP, CONTEXT_MODULE, CONTEXT_BLOCK);
 
+    // This is really a systen context
+    if ($contextlevel == CONTEXT_COURSE && $instance == SITEID) {
+        $contextlevel = CONTEXT_SYSTEM;
+    }
+
 /// If no level is supplied then return the current global context if there is one
     if (empty($contextlevel)) {
         if (empty($CONTEXT)) {