diff --git a/lib/moodlelib.php b/lib/moodlelib.php index eabb8b71d85..a99a8e79cfa 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -390,6 +390,9 @@ function require_login($courseid=0, $autologinguest=true) { // Next, check if the user can be in a particular course if ($courseid) { + if ($courseid == SITEID) { + return; // Anyone can be in the site course + } if (!empty($USER->student[$courseid]) or !empty($USER->teacher[$courseid]) or !empty($USER->admin)) { if (isset($USER->realuser)) { // Make sure the REAL person can also access this course if (!isteacher($courseid, $USER->realuser)) {