mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
DML-30588 do not require enrollment after switching of roles
This commit is contained in:
parent
acb3bf8ac1
commit
e467ed219f
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue