accesslib/moodlelib: check $USER->access[rsw] for roleswitches

This commit is contained in:
martinlanghoff
2007-09-19 07:15:50 +00:00
parent 0e801c6c9d
commit 51be70d2e2
2 changed files with 2 additions and 20 deletions
+1 -1
View File
@@ -1820,7 +1820,7 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null) {
$strloggedinasguest = get_string('loggedinasguest');
print_header_simple('', '',
build_navigation(array(array('name' => $strloggedinasguest, 'link' => null, 'type' => 'misc'))));
if (empty($USER->switchrole[$context->id])) { // Normal guest
if (empty($USER->access['rsw'][$context->path])) { // Normal guest
notice(get_string('guestsnotallowed', '', format_string($COURSE->fullname)), "$CFG->wwwroot/login/index.php");
} else {
notify(get_string('guestsnotallowed', '', format_string($COURSE->fullname)));