Merge branch 'w51_MDL-30588_m23_switchrole' of git://github.com/skodak/moodle

This commit is contained in:
Sam Hemelryk
2011-12-12 17:10:58 +13:00
+5 -1
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;