diff --git a/course/enrol.php b/course/enrol.php index 0ebb95e..551d35d 100644 --- a/course/enrol.php +++ b/course/enrol.php @@ -11,6 +11,8 @@ $loginasguest = optional_param('loginasguest', 0, PARAM_BOOL); // hmm, is this still needed? if (!isloggedin()) { + // Force login and ignore Auto-login guest to enrol a user into this course. Refs: MDL-7903. + require_login($id, false); $wwwroot = $CFG->wwwroot; if (!empty($CFG->loginhttps)) { $wwwroot = str_replace('http:','https:', $wwwroot);