Skip to content
Browse files

Merge branch 'w51_MDL-30588_m21_switchrole' of git://github.com/skoda…

…k/moodle into MOODLE_21_STABLE
  • Loading branch information...
2 parents dfda3ef + 8caf506 commit 860551428c35d226e3752efbe139e7b47b4c9760 Sam Hemelryk committed Dec 12, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/moodlelib.php
View
6 lib/moodlelib.php
@@ -2529,7 +2529,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;

0 comments on commit 8605514

Please sign in to comment.
Something went wrong with that request. Please try again.