DML-30588 do not require enrollment after switching of roles
This commit is contained in:
+5
-1
@@ -2760,7 +2760,11 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
|
||||
|
||||
$access = false;
|
||||
|
||||
if (is_viewing($coursecontext, $USER)) {
|
||||
if (is_role_switched($course->id)) {
|
||||
// ok, user had to be inside this course before the switch
|
||||
$access = true;
|
||||
|
||||
} else if (is_viewing($coursecontext, $USER)) {
|
||||
// ok, no need to mess with enrol
|
||||
$access = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user