Skip to content
Snippets Groups Projects
Commit 8c6b1ed3 authored by strentini's avatar strentini
Browse files

OO-43 : only check for quota if file was selected (and thus uploaded) -> prevent RS

parent 11641d1b
No related branches found
No related tags found
No related merge requests found
...@@ -190,18 +190,20 @@ public class EpisodeFormController extends FormBasicController { ...@@ -190,18 +190,20 @@ public class EpisodeFormController extends FormBasicController {
} else { } else {
flc.setDirty(true); flc.setDirty(true);
} }
}
// quota check
if(baseDir.getLocalSecurityCallback() == null || baseDir.getLocalSecurityCallback().getQuota() != null) { if(baseDir.getLocalSecurityCallback() == null || baseDir.getLocalSecurityCallback().getQuota() != null) {
Quota feedQuota = baseDir.getLocalSecurityCallback().getQuota(); Quota feedQuota = baseDir.getLocalSecurityCallback().getQuota();
Long remainingQuotaKb = feedQuota.getRemainingSpace(); Long remainingQuotaKb = feedQuota.getRemainingSpace();
if (remainingQuotaKb != -1 && file.getUploadFile().length() / 1024 > remainingQuotaKb) { if (remainingQuotaKb != -1 && file.getUploadFile().length() / 1024 > remainingQuotaKb) {
String supportAddr = WebappHelper.getMailConfig("mailSupport"); String supportAddr = WebappHelper.getMailConfig("mailSupport");
Long uploadLimitKB = feedQuota.getUlLimitKB(); Long uploadLimitKB = feedQuota.getUlLimitKB();
getWindowControl().setError(translate("ULLimitExceeded", new String[] { Formatter.roundToString(uploadLimitKB.floatValue() / 1024f, 1), supportAddr })); getWindowControl().setError(translate("ULLimitExceeded", new String[] { Formatter.roundToString(uploadLimitKB.floatValue() / 1024f, 1), supportAddr }));
}
} }
} }
//fxdiff FXOLAT-118: size for video podcast //fxdiff FXOLAT-118: size for video podcast
String width = widthEl.getValue(); String width = widthEl.getValue();
widthEl.clearError(); widthEl.clearError();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment