Merge branch 'wip-mdl-30792' of git://github.com/rajeshtaneja/moodle

This commit is contained in:
Eloy Lafuente (stronk7)
2012-08-08 01:00:12 +02:00
3 changed files with 11 additions and 12 deletions
+3 -3
View File
@@ -5861,15 +5861,15 @@ function get_max_upload_file_size($sitebytes=0, $coursebytes=0, $modulebytes=0)
}
}
if ($sitebytes and $sitebytes < $minimumsize) {
if (($sitebytes > 0) and ($sitebytes < $minimumsize)) {
$minimumsize = $sitebytes;
}
if ($coursebytes and $coursebytes < $minimumsize) {
if (($coursebytes > 0) and ($coursebytes < $minimumsize)) {
$minimumsize = $coursebytes;
}
if ($modulebytes and $modulebytes < $minimumsize) {
if (($modulebytes > 0) and ($modulebytes < $minimumsize)) {
$minimumsize = $modulebytes;
}
+3 -5
View File
@@ -89,11 +89,9 @@ if ($repo_id) {
}
$context = context::instance_by_id($contextid);
$moodle_maxbytes = get_user_max_upload_file_size($context);
// to prevent maxbytes greater than moodle maxbytes setting
if ($maxbytes == 0 || $maxbytes>=$moodle_maxbytes) {
$maxbytes = $moodle_maxbytes;
}
// Make sure maxbytes passed is within site filesize limits.
$maxbytes = get_user_max_upload_file_size($context, $CFG->maxbytes, $course->maxbytes, $maxbytes);
$params = array('ctx_id' => $contextid, 'itemid' => $itemid, 'env' => $env, 'course'=>$courseid, 'maxbytes'=>$maxbytes, 'maxfiles'=>$maxfiles, 'subdirs'=>$subdirs, 'sesskey'=>sesskey());
$params['action'] = 'browse';
+5 -4
View File
@@ -79,11 +79,12 @@ $repo = repository::get_repository_by_id($repo_id, $contextid, $repooptions);
// Check permissions
$repo->check_capability();
$moodle_maxbytes = get_user_max_upload_file_size($context);
// to prevent maxbytes greater than moodle maxbytes setting
if ($maxbytes == 0 || $maxbytes>=$moodle_maxbytes) {
$maxbytes = $moodle_maxbytes;
$coursemaxbytes = 0;
if (!empty($course)) {
$coursemaxbytes = $course->maxbytes;
}
// Make sure maxbytes passed is within site filesize limits.
$maxbytes = get_user_max_upload_file_size($context, $CFG->maxbytes, $coursemaxbytes, $maxbytes);
// Wait as long as it takes for this script to finish
set_time_limit(0);