]> git.mjollnir.org Git - moodle.git/commitdiff
fixed - disabled autologinguest not always respected in require_login() SC#255; merge...
authorskodak <skodak>
Fri, 19 May 2006 19:11:30 +0000 (19:11 +0000)
committerskodak <skodak>
Fri, 19 May 2006 19:11:30 +0000 (19:11 +0000)
lib/moodlelib.php

index 88deb9bdf6a747b656f623a6fac53fb006b1704d..fbcbf840ff76b0bb6d451f80fb72d4695d90e86a 100644 (file)
@@ -1621,9 +1621,10 @@ function require_login($courseid=0, $autologinguest=true, $cm=null) {
         }
 
         //User is not enrolled in the course, wants to access course content
-        //as a guest, and course setting allow unlimited guest access
+        //as a guest, and course setting allow unlimited guest access;
+        //do not autologin as guest when $autologinguest is false
         //Code cribbed from course/loginas.php
-        if (strstr($FULLME,"username=guest") && ($course->guest==1)) {
+        if (strstr($FULLME,"username=guest") and ($course->guest==1) and $autologinguest) {
             $realuser = $USER->id;
             $realname = fullname($USER, true);
             $USER = guest_user();