]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12382 allow admins to access any course - including courses where they have guest...
authorskodak <skodak>
Mon, 18 Feb 2008 23:34:38 +0000 (23:34 +0000)
committerskodak <skodak>
Mon, 18 Feb 2008 23:34:38 +0000 (23:34 +0000)
lib/moodlelib.php

index 5c89fc35bb4603e8b00ffa5f67d9e3fc709ad9b6..37abbaa816a29da7a92a786f88d87ef8ab826a1e 100644 (file)
@@ -1957,6 +1957,11 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null) {
     /// If the user is a guest then treat them according to the course policy about guests
 
         if (has_capability('moodle/legacy:guest', $COURSE->context, NULL, false)) {
+            if (has_capability('moodle/site:doanything', $sysctx)) {
+                // administrators must be able to access any course - even if somebody gives them guest access
+                return true;
+            }
+
             switch ($COURSE->guest) {    /// Check course policy about guest access
 
                 case 1:    /// Guests always allowed