From 955679bcf38b639edb96c048cde0bd9acedb23ef Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Wed, 19 Sep 2007 07:16:43 +0000 Subject: [PATCH] moodlelib: require_login() - assign tempguest role using load_temp_role() And remove the explicit handling of deprecated $USER->capabilities --- lib/moodlelib.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 8cd475b25d..82342ade81 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -1784,9 +1784,7 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null) { if ($USER->username != 'guest' and !has_capability('moodle/course:view', $context)) { if ($COURSE->guest == 1) { // Temporarily assign them guest role for this context, if it fails later user is asked to enrol - has_capability('clearcache'); // Must clear cache - $guestcaps = get_role_context_caps($CFG->guestroleid, $context); - $USER->capabilities = merge_role_caps($USER->capabilities, $guestcaps); + $USER->access = load_temp_role($context, $CFG->guestroleid, $USER->access); } } -- 2.39.5