Commit 760cc82b authored by Andrew Robert Nicols's avatar Andrew Robert Nicols Committed by Evan Goldenberg
Browse files

Only include user quota in the quota calculation if uploading files for a specific user

If uploading files for a group or an institution, do not include the user
(cherry picked from commit 45d57645244d8866a291101e70f8fe2fcf6e759c)

Signed-off-by: default avatarEvan Goldenberg <>
parent 8b6ee6b1
......@@ -103,7 +103,12 @@ function pieform_element_filebrowser(Pieform $form, $element) {
if ($config['upload']) {
$maxuploadsize = display_size(min(get_real_size(ini_get('post_max_size')), get_real_size(ini_get('upload_max_filesize')),$USER->get('quota')-$USER->get('quotaused')));
$maxuploadsize = min(get_real_size(ini_get('post_max_size')), get_real_size(ini_get('upload_max_filesize')));
if (!$institution && !$group) {
$userquotaremaining = $USER->get('quota') - $USER->get('quotaused');
$maxuploadsize = min($maxuploadsize, $userquotaremaining);
$maxuploadsize = display_size($maxuploadsize);
$smarty->assign('maxuploadsize', $maxuploadsize);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment