MDL-12382 allow admins to access any course - including courses where they have guest role and course does not allow guests; merged from MOODLE_19_STABLE

This commit is contained in:
skodak 2008-02-18 23:40:21 +00:00
parent 5f431c1bad
commit b03f7215c7

View file

@ -1959,7 +1959,7 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null) {
if (has_capability('moodle/legacy:guest', $COURSE->context, NULL, false)) { if (has_capability('moodle/legacy:guest', $COURSE->context, NULL, false)) {
if (has_capability('moodle/site:doanything', $sysctx)) { if (has_capability('moodle/site:doanything', $sysctx)) {
// administrators must be able to access any course - even if somebody gives them guest access // administrators must be able to access any course - even if somebody gives them guest access
return true; return;
} }
switch ($COURSE->guest) { /// Check course policy about guest access switch ($COURSE->guest) { /// Check course policy about guest access