DML-30588 do not require enrollment after switching of roles

This commit is contained in:
Petr Skoda 2011-12-10 12:44:32 +01:00
parent acb3bf8ac1
commit e467ed219f

View file

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