diff options
author | Simon Rettberg | 2022-11-07 14:30:44 +0100 |
---|---|---|
committer | Simon Rettberg | 2022-11-07 14:30:44 +0100 |
commit | ebeac0b8ea82b0f3c929bfb4fd803fa132c649fc (patch) | |
tree | b649d06059e79d7573af64896aa10cc28dd416e8 | |
parent | [server] Ignore VM size limit for super user (diff) | |
download | tutor-module-ebeac0b8ea82b0f3c929bfb4fd803fa132c649fc.tar.gz tutor-module-ebeac0b8ea82b0f3c929bfb4fd803fa132c649fc.tar.xz tutor-module-ebeac0b8ea82b0f3c929bfb4fd803fa132c649fc.zip |
[client] Ignore VM size limit if user is super user
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java index 44ae307f..8e033f2f 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java @@ -337,15 +337,18 @@ public class ImageUploadPage extends ImageUploadPageLayout { } // Check imposed size limit by server - long maxSize = Session.getSatelliteConfig().vmSizeLimit; - if (maxSize > 0 && maxSize < vmDiskFileInfo.length()) { - Gui.showMessageBox( - I18n.PAGE.getString("ImageUpload.Message.warning.diskImageTooBig", - FormatHelper.bytes(maxSize, false), FormatHelper.bytes(vmDiskFileInfo.length(), false)), - MessageType.WARNING, null, null); - setErrorMessage(I18n.PAGE.getString("ImageUpload.WizardPage.errorMessage.diskImageTooBig")); - setPageComplete(false); - return; + if (!Session.isSuperUser()) { + long maxSize = Session.getSatelliteConfig().vmSizeLimit; + if (maxSize > 0 && maxSize < vmDiskFileInfo.length()) { + Gui.showMessageBox( + I18n.PAGE.getString("ImageUpload.Message.warning.diskImageTooBig", + FormatHelper.bytes(maxSize, false), + FormatHelper.bytes(vmDiskFileInfo.length(), false)), + MessageType.WARNING, null, null); + setErrorMessage(I18n.PAGE.getString("ImageUpload.WizardPage.errorMessage.diskImageTooBig")); + setPageComplete(false); + return; + } } // everything seems fine so far |