MDL-23202 group icons now stored in file storage pool
This commit is contained in:
+14
-4
@@ -524,10 +524,7 @@ if ($component === 'blog') {
|
||||
send_file_not_found();
|
||||
}
|
||||
|
||||
if ($filearea === 'description' or $filearea === 'icon') {
|
||||
|
||||
//TODO: implement group image storage in file pool
|
||||
|
||||
if ($filearea === 'description') {
|
||||
$filename = array_pop($args);
|
||||
$filepath = $args ? '/'.implode('/', $args).'/' : '/';
|
||||
if (!$file = $fs->get_file($context->id, 'group', 'description', $group->id, $filepath, $filename) or $file->is_directory()) {
|
||||
@@ -537,6 +534,19 @@ if ($component === 'blog') {
|
||||
session_get_instance()->write_close(); // unlock session during fileserving
|
||||
send_stored_file($file, 60*60, 0, $forcedownload);
|
||||
|
||||
} else if ($filearea === 'icon') {
|
||||
$filename = array_pop($args);
|
||||
|
||||
if ($filename !== 'f1' and $filename !== 'f2') {
|
||||
send_file_not_found();
|
||||
}
|
||||
if (!$file = $fs->get_file($context->id, 'group', 'icon', $group->id, '/', $filename.'.jpg')) {
|
||||
send_file_not_found();
|
||||
}
|
||||
|
||||
session_get_instance()->write_close(); // unlock session during fileserving
|
||||
send_stored_file($file, 60*60);
|
||||
|
||||
} else {
|
||||
send_file_not_found();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user