fixed - disabled autologinguest not always respected in require_login() SC#255; merged from MOODLE_16_STABLE
This commit is contained in:
+3
-2
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user