mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 02:46:40 +02:00
Merge branch 'MDL-44626-master' of git://github.com/andrewnicols/moodle
This commit is contained in:
commit
220f8115d9
4 changed files with 13 additions and 6 deletions
|
@ -876,7 +876,6 @@ M.form_dndupload.init = function(Y, options) {
|
|||
|
||||
// Prepare the data to send
|
||||
var formdata = new FormData();
|
||||
formdata.append('action', 'upload');
|
||||
formdata.append('repo_upload_file', file); // The FormData class allows us to attach a file
|
||||
formdata.append('sesskey', M.cfg.sesskey);
|
||||
formdata.append('repo_id', this.repositoryid);
|
||||
|
@ -905,8 +904,14 @@ M.form_dndupload.init = function(Y, options) {
|
|||
formdata.append('accepted_types[]', this.options.acceptedtypes);
|
||||
}
|
||||
|
||||
// Send the file & required details
|
||||
xhr.open("POST", this.api, true);
|
||||
// Send the file & required details.
|
||||
var uploadUrl = this.api;
|
||||
if (uploadUrl.indexOf('?') !== -1) {
|
||||
uploadUrl += '&action=upload';
|
||||
} else {
|
||||
uploadUrl += '?action=upload';
|
||||
}
|
||||
xhr.open("POST", uploadUrl, true);
|
||||
xhr.send(formdata);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -6192,7 +6192,7 @@ function get_user_max_upload_file_size($context, $sitebytes = 0, $coursebytes =
|
|||
}
|
||||
|
||||
if (has_capability('moodle/course:ignorefilesizelimits', $context, $user)) {
|
||||
return USER_CAN_IGNORE_FILE_SIZE_LIMITS;
|
||||
return get_max_upload_file_size(USER_CAN_IGNORE_FILE_SIZE_LIMITS);
|
||||
}
|
||||
|
||||
return get_max_upload_file_size($sitebytes, $coursebytes, $modulebytes);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue