mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
Make it easier to get out of a switched role in case viewing is not allowed
This commit is contained in:
parent
e8928a65fd
commit
ac4c51bef5
@ -41,11 +41,15 @@
|
||||
print_error('nocontext');
|
||||
}
|
||||
|
||||
if ($switchrole == 0) { // Remove any switched roles before checking login
|
||||
role_switch($switchrole, $context);
|
||||
}
|
||||
|
||||
require_login($course->id);
|
||||
|
||||
if ($switchrole > -1) {
|
||||
if ($switchrole > 0) {
|
||||
role_switch($switchrole, $context);
|
||||
require_login($course->id);
|
||||
require_login($course->id); // Double check that this role is allowed here
|
||||
}
|
||||
|
||||
//If course is hosted on an external server, redirect to corresponding
|
||||
|
Loading…
x
Reference in New Issue
Block a user