diff --git a/calendar/view.php b/calendar/view.php index 057f2254f2a..59a4cbda0d6 100644 --- a/calendar/view.php +++ b/calendar/view.php @@ -114,7 +114,9 @@ if ($iscoursecalendar && !empty($courseid)) { $PAGE->set_context(context_system::instance()); } -require_login($course, false); +// Auto log in guests on frontpage. +$autologinguest = !$iscoursecalendar; +require_login($course, $autologinguest); $calendar = calendar_information::create($time, $courseid, $categoryid);