From 073e8e0b28d73bf16443ebcef944ae38c3ffafe4 Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Thu, 8 Aug 2024 12:23:54 +0200 Subject: [PATCH] Changed invited page to force guest login (even when disabled) instead of no login at all --- invited.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/invited.php b/invited.php index a9ae74c..ad03d9c 100644 --- a/invited.php +++ b/invited.php @@ -23,6 +23,12 @@ require_once("../../config.php"); // Since this page is externally accessed and validated in a different way, no login is needed. +// In fact, we need to override the behaviour of require_login to force "guest access" here, even if the configuration says differently +$autologin = $CFG->autologinguests; // Store current guest autologin configuration value. +$CFG->autologinguests = 1; // Override guest autologin configuration value. +require_login(null,true); // Trigger require_login to make sure we have guest access +$CFG->autologinguests = $autologin; // Restore old guest autologin configuration value +unset($autologin); $systemcontext = context_system::instance();