Even when a user has the appropriate capability to upload any sized files,
they are still restricted to the PHP post_max_size, and upload_max_filesize
values.
Rather than showing a value of "Unlimited', we should always restrict to
this value.
}
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);
$siteinfo = external_api::clean_returnvalue(core_webservice_external::get_site_info_returns(), $siteinfo);
$this->assertEquals(0, $siteinfo['userquota']);
- $this->assertEquals(USER_CAN_IGNORE_FILE_SIZE_LIMITS, $siteinfo['usermaxuploadfilesize']);
+
+ // The max_size is dependant upon the post_max_size, and upload_max_filesize values in php.ini.
+ $this->assertEquals(get_max_upload_file_size(USER_CAN_IGNORE_FILE_SIZE_LIMITS), $siteinfo['usermaxuploadfilesize']);
$this->assertEquals(true, $siteinfo['usercanmanageownfiles']);
$this->assertEquals(HOMEPAGE_SITE, $siteinfo['userhomepage']);