Permalink
Browse files

DML-30588 do not require enrollment after switching of roles

  • Loading branch information...
1 parent acb3bf8 commit e467ed219f371bd730f75aff95aa1fd7f73188b4 @skodak skodak committed Dec 10, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/moodlelib.php
View
@@ -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;

0 comments on commit e467ed2

Please sign in to comment.