MDL-30731 calendar: Fixed display of images in event descriptions
This commit is contained in:
+5
-6
@@ -3685,7 +3685,6 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null) {
|
||||
if (!$event = $DB->get_record('event', array('id'=>(int)$eventid, 'eventtype'=>'site'))) {
|
||||
send_file_not_found();
|
||||
}
|
||||
// Check that we got an event and that it's userid is that of the user
|
||||
|
||||
// Get the file and serve if successful
|
||||
$filename = array_pop($args);
|
||||
@@ -3733,8 +3732,8 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null) {
|
||||
require_login($course);
|
||||
}
|
||||
|
||||
// Must be able to at least view the course
|
||||
if (!is_enrolled($context) and !is_viewing($context)) {
|
||||
// Must be able to at least view the course. This does not apply to the front page.
|
||||
if ($course->id != SITEID && (!is_enrolled($context)) && (!is_viewing($context))) {
|
||||
//TODO: hmm, do we really want to block guests here?
|
||||
send_file_not_found();
|
||||
}
|
||||
@@ -3755,10 +3754,10 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null) {
|
||||
if (!has_capability('moodle/site:accessallgroups', $context) && !groups_is_member($event->groupid, $USER->id)) {
|
||||
send_file_not_found();
|
||||
}
|
||||
} else if ($event->eventtype === 'course') {
|
||||
//ok
|
||||
} else if ($event->eventtype === 'course' || $event->eventtype === 'site') {
|
||||
// Ok. Please note that the event type 'site' still uses a course context.
|
||||
} else {
|
||||
// some other type
|
||||
// Some other type.
|
||||
send_file_not_found();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user