mirror of
https://github.com/moodle/moodle.git
synced 2025-03-18 14:40:06 +01:00
MDL-35429 restore: fixed downloading of automated backup files
This commit is contained in:
parent
f2faf9fae6
commit
521d900f06
@ -338,7 +338,9 @@ class file_info_context_course extends file_info {
|
||||
}
|
||||
}
|
||||
|
||||
$downloadable = has_capability('moodle/site:config', $this->context);
|
||||
// Automated backup files are only downloadable if the user has both 'backup:downloadfile and 'restore:userinfo'.
|
||||
$downloadable = has_capability('moodle/backup:downloadfile', $this->context) &&
|
||||
has_capability('moodle/restore:userinfo', $this->context);
|
||||
$uploadable = false;
|
||||
|
||||
$urlbase = $CFG->wwwroot.'/pluginfile.php';
|
||||
|
@ -4623,7 +4623,8 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null, $offlin
|
||||
// Backup files that were generated by the automated backup systems.
|
||||
|
||||
require_login($course);
|
||||
require_capability('moodle/site:config', $context);
|
||||
require_capability('moodle/backup:downloadfile', $context);
|
||||
require_capability('moodle/restore:userinfo', $context);
|
||||
|
||||
$filename = array_pop($args);
|
||||
$filepath = $args ? '/'.implode('/', $args).'/' : '/';
|
||||
|
Loading…
x
Reference in New Issue
Block a user