Merged patches from MDL-8385 from 1.8 stable

This commit is contained in:
moodler
2007-03-07 13:45:41 +00:00
parent c16ba031ac
commit eef879ecdb
2 changed files with 139 additions and 145 deletions
+4 -3
View File
@@ -1743,9 +1743,10 @@ 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 user is asked to enrol
load_guest_role($context);
// 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);
}
}