Make it easier to get out of a switched role in case viewing is not allowed

This commit is contained in:
moodler 2006-09-22 01:29:11 +00:00
parent e8928a65fd
commit ac4c51bef5

View File

@ -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