fixed - disabled autologinguest not always respected in require_login() SC#255; merged from MOODLE_16_STABLE

This commit is contained in:
skodak
2006-05-19 19:11:30 +00:00
parent f08ab5f020
commit 4a10c3875b
+3 -2
View 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();