You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by an...@apache.org on 2017/10/02 14:05:43 UTC
syncope git commit: [SYNCOPE-1213] managed maximum file size control
manually, renamed maxFileSize into maxUploadFileSize
Repository: syncope
Updated Branches:
refs/heads/2_0_X 2056da810 -> 0155bba1c
[SYNCOPE-1213] managed maximum file size control manually, renamed maxFileSize into maxUploadFileSize
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/0155bba1
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/0155bba1
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/0155bba1
Branch: refs/heads/2_0_X
Commit: 0155bba1c01f51cd0db1e937d6e7803383303442
Parents: 2056da8
Author: Andrea Patricelli <an...@apache.org>
Authored: Mon Oct 2 15:32:43 2017 +0200
Committer: Andrea Patricelli <an...@apache.org>
Committed: Mon Oct 2 15:32:43 2017 +0200
----------------------------------------------------------------------
.../console/SyncopeConsoleApplication.java | 10 +++--
.../markup/html/form/BinaryFieldPanel.java | 47 ++++++++++++--------
.../wicket/markup/html/form/FieldPanel.java | 9 +++-
.../console/wizards/any/AbstractAttrs.java | 7 +++
.../console/wizards/any/AnyWizardBuilder.java | 11 ++++-
.../client/console/wizards/any/PlainAttrs.java | 13 +++++-
.../src/main/resources/console.properties | 2 +-
.../html/form/BinaryFieldPanel.properties | 17 +++++++
.../enduser/SyncopeEnduserApplication.java | 8 ++--
.../enduser/adapters/PlatformInfoAdapter.java | 2 +-
.../enduser/model/PlatformInfoRequest.java | 10 ++---
.../resources/META-INF/resources/app/js/app.js | 8 ++--
.../resources/app/js/directives/fileInput.js | 2 +-
.../src/main/resources/enduser.properties | 2 +-
.../src/main/resources/console.properties | 2 +-
.../src/test/resources/console.properties | 2 +-
.../src/main/resources/enduser.properties | 2 +-
.../src/test/resources/enduser.properties | 2 +-
18 files changed, 110 insertions(+), 46 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
index 323b384..4bf1188 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
@@ -107,7 +107,7 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
private String useGZIPCompression;
- private Integer maxFileSizeMB;
+ private Integer maxUploadFileSizeMB;
private List<String> domains;
@@ -158,7 +158,9 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
Args.notNull(rootPath, "<rootPath>");
useGZIPCompression = props.getProperty("useGZIPCompression");
Args.notNull(useGZIPCompression, "<useGZIPCompression>");
- maxFileSizeMB = Integer.valueOf(props.getProperty("maxFileSizeMB", "4"));
+ maxUploadFileSizeMB = props.getProperty("maxUploadFileSizeMB") == null
+ ? null
+ : Integer.valueOf(props.getProperty("maxUploadFileSizeMB"));
String csrf = props.getProperty("csrf");
@@ -308,8 +310,8 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
return reconciliationReportKey;
}
- public Integer getMaxFileSizeMB() {
- return maxFileSizeMB;
+ public Integer getMaxUploadFileSizeMB() {
+ return maxUploadFileSizeMB;
}
public SyncopeClientFactoryBean newClientFactory() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.java
index ff5bf1e..962a8c9 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.java
@@ -36,6 +36,7 @@ import org.apache.syncope.client.console.SyncopeConsoleSession;
import org.apache.syncope.client.console.commons.Constants;
import org.apache.syncope.client.console.commons.HttpResourceStream;
import org.apache.syncope.client.console.commons.PreviewUtils;
+import org.apache.syncope.client.console.pages.BasePage;
import org.apache.syncope.client.console.wicket.markup.html.form.preview.AbstractBinaryPreviewer;
import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -77,12 +78,12 @@ public class BinaryFieldPanel extends FieldPanel<String> {
private final AjaxDownload fileDownload;
- private final transient PreviewUtils previewUtils = PreviewUtils.getInstance();
-
private final AbstractBinaryPreviewer previewer;
private final IndicatingAjaxLink<Void> resetLink;
+ private final Bytes maxUploadSize;
+
public BinaryFieldPanel(final String id, final String name, final IModel<String> model, final String mimeType,
final String fileKey) {
super(id, name, model);
@@ -90,9 +91,11 @@ public class BinaryFieldPanel extends FieldPanel<String> {
previewer = PREVIEW_UTILS.getPreviewer(mimeType);
+ maxUploadSize = SyncopeConsoleApplication.get().getMaxUploadFileSizeMB() == null
+ ? null
+ : Bytes.megabytes(SyncopeConsoleApplication.get().getMaxUploadFileSizeMB());
uploadForm = new StatelessForm<>("uploadForm");
uploadForm.setMultiPart(true);
- uploadForm.setMaxSize(Bytes.megabytes(SyncopeConsoleApplication.get().getMaxFileSizeMB()));
add(uploadForm);
container = new WebMarkupContainer("previewContainer") {
@@ -177,24 +180,32 @@ public class BinaryFieldPanel extends FieldPanel<String> {
protected void onSubmit(final AjaxRequestTarget target) {
final FileUpload uploadedFile = fileUpload.getFileUpload();
if (uploadedFile != null) {
- final byte[] uploadedBytes = uploadedFile.getBytes();
- final String uploaded = new String(Base64.encodeBase64(uploadedBytes), StandardCharsets.UTF_8);
- field.setModelObject(uploaded);
- target.add(field);
-
- if (previewer == null) {
- container.addOrReplace(emptyFragment);
+ if (maxUploadSize != null && uploadedFile.getSize() > maxUploadSize.bytes()) {
+ // SYNCOPE-1213 manage directly max upload file size (if set in properties file)
+ SyncopeConsoleSession.get().error(getString("tooLargeFile")
+ .replace("${maxUploadSizeB}", String.valueOf(maxUploadSize.bytes()))
+ .replace("${maxUploadSizeMB}", String.valueOf(maxUploadSize.bytes() / 1000000L)));
+ ((BasePage) getPageReference().getPage()).getNotificationPanel().refresh(target);
} else {
- final Component panelPreview = previewer.preview(uploadedBytes);
- changePreviewer(panelPreview);
- fileUpload.setModelObject(null);
- uploadForm.addOrReplace(fileUpload);
- }
+ final byte[] uploadedBytes = uploadedFile.getBytes();
+ final String uploaded = new String(Base64.encodeBase64(uploadedBytes), StandardCharsets.UTF_8);
+ field.setModelObject(uploaded);
+ target.add(field);
+
+ if (previewer == null) {
+ container.addOrReplace(emptyFragment);
+ } else {
+ final Component panelPreview = previewer.preview(uploadedBytes);
+ changePreviewer(panelPreview);
+ fileUpload.setModelObject(null);
+ uploadForm.addOrReplace(fileUpload);
+ }
- setVisibleFileButtons(StringUtils.isNotBlank(uploaded));
- downloadLink.setEnabled(StringUtils.isNotBlank(uploaded));
+ setVisibleFileButtons(StringUtils.isNotBlank(uploaded));
+ downloadLink.setEnabled(StringUtils.isNotBlank(uploaded));
- target.add(uploadForm);
+ target.add(uploadForm);
+ }
}
}
});
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.java
index 0f31060..aa8cead 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.java
@@ -26,6 +26,7 @@ import java.util.List;
import org.apache.commons.lang3.SerializationUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.PageReference;
import org.apache.wicket.markup.html.form.FormComponent;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.model.IModel;
@@ -69,7 +70,7 @@ public abstract class FieldPanel<T extends Serializable> extends AbstractFieldPa
Model.<String>of(),
title == null ? Model.<String>of() : Model.of(title),
new PopoverConfig().withHtml(html).withHoverTrigger().withPlacement(
- index.getObject() != null && index.getObject() == 0
+ index.getObject() != null && index.getObject() == 0
? TooltipConfig.Placement.bottom
: this instanceof AjaxCheckBoxPanel
? TooltipConfig.Placement.right
@@ -205,4 +206,10 @@ public abstract class FieldPanel<T extends Serializable> extends AbstractFieldPa
panel.addLabel();
return panel;
}
+
+ protected PageReference getPageReference() {
+ // SYNCOPE-1213
+ // default implementation does not requier to pass page reference, override this method of want otherwise
+ return null;
+ }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AbstractAttrs.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AbstractAttrs.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AbstractAttrs.java
index 88a792c..334a97f 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AbstractAttrs.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AbstractAttrs.java
@@ -40,6 +40,7 @@ import org.apache.syncope.common.lib.to.AttrTO;
import org.apache.syncope.common.lib.to.GroupTO;
import org.apache.syncope.common.lib.to.MembershipTO;
import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.wicket.PageReference;
import org.apache.wicket.WicketRuntimeException;
import org.apache.wicket.core.util.lang.PropertyResolver;
import org.apache.wicket.extensions.wizard.WizardModel.ICondition;
@@ -228,6 +229,12 @@ public abstract class AbstractAttrs<S extends AbstractSchemaTO> extends WizardSt
return CollectionUtils.isNotEmpty(attrTOs.getObject()) || CollectionUtils.isNotEmpty(membershipTOs.getObject());
}
+ public PageReference getPageReference() {
+ // SYNCOPE-1213
+ // default implementation does not requier to pass page reference, override this method of want otherwise
+ return null;
+ }
+
protected static class AttrComparator implements Comparator<AttrTO>, Serializable {
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyWizardBuilder.java
index 37377ef..2ac9b60 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyWizardBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyWizardBuilder.java
@@ -114,7 +114,16 @@ public abstract class AnyWizardBuilder<A extends AnyTO> extends AjaxWizardBuilde
null,
mode,
anyTypeClasses,
- formLayoutInfo.getWhichPlainAttrs()));
+ formLayoutInfo.getWhichPlainAttrs()) {
+
+ private static final long serialVersionUID = 8167894751609598306L;
+
+ @Override
+ public PageReference getPageReference() {
+ return pageRef;
+ }
+
+ });
}
if (formLayoutInfo.isDerAttrs() && mode != AjaxWizard.Mode.TEMPLATE) {
wizardModel.add(new DerAttrs(
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java
index bc9498c..3064d3d 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java
@@ -52,6 +52,7 @@ import org.apache.syncope.common.lib.to.PlainSchemaTO;
import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.lib.types.AttrSchemaType;
import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.wicket.PageReference;
import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
import org.apache.wicket.extensions.markup.html.tabs.ITab;
import org.apache.wicket.markup.html.WebMarkupContainer;
@@ -311,8 +312,18 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
break;
case Binary:
+ final PageReference pageReference = getPageReference();
panel = new BinaryFieldPanel("panel", schemaTO.getKey(), new Model<String>(), schemaTO.getMimeType(),
- fileKey);
+ fileKey) {
+
+ private static final long serialVersionUID = -3268213909514986831L;
+
+ @Override
+ protected PageReference getPageReference() {
+ return pageReference;
+ }
+
+ };
if (required) {
panel.addRequiredLabel();
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/client/console/src/main/resources/console.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/console.properties b/client/console/src/main/resources/console.properties
index 47b7035..abe33c1 100644
--- a/client/console/src/main/resources/console.properties
+++ b/client/console/src/main/resources/console.properties
@@ -26,7 +26,7 @@ host=localhost
port=8080
rootPath=/syncope/rest/
useGZIPCompression=true
-maxFileSizeMB=5
+maxUploadFileSizeMB=5
csrf=true
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.properties
new file mode 100644
index 0000000..6db49af
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+tooLargeFile=File is too large, max upload file size is ${maxUploadSizeB} bytes (${maxUploadSizeMB} MB).
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
index a4225d9..dcf3a25 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
@@ -83,7 +83,7 @@ public class SyncopeEnduserApplication extends WebApplication implements Seriali
private boolean xsrfEnabled;
- private Integer maxFileSizeMB;
+ private Integer maxUploadFileSizeMB;
private SyncopeClientFactoryBean clientFactory;
@@ -122,7 +122,7 @@ public class SyncopeEnduserApplication extends WebApplication implements Seriali
Args.notNull(rootPath, "<rootPath>");
String useGZIPCompression = props.getProperty("useGZIPCompression");
Args.notNull(useGZIPCompression, "<useGZIPCompression>");
- maxFileSizeMB = Integer.valueOf(props.getProperty("maxFileSizeMB", "4"));
+ maxUploadFileSizeMB = Integer.valueOf(props.getProperty("maxUploadFileSizeMB"));
clientFactory = new SyncopeClientFactoryBean().
setAddress(scheme + "://" + host + ":" + port + "/" + rootPath).
@@ -281,8 +281,8 @@ public class SyncopeEnduserApplication extends WebApplication implements Seriali
return xsrfEnabled;
}
- public Integer getMaxFileSizeMB() {
- return maxFileSizeMB;
+ public Integer getMaxUploadFileSizeMB() {
+ return maxUploadFileSizeMB;
}
public Map<String, CustomAttributesInfo> getCustomForm() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/client/enduser/src/main/java/org/apache/syncope/client/enduser/adapters/PlatformInfoAdapter.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/adapters/PlatformInfoAdapter.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/adapters/PlatformInfoAdapter.java
index 999f496..c169010 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/adapters/PlatformInfoAdapter.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/adapters/PlatformInfoAdapter.java
@@ -34,7 +34,7 @@ public final class PlatformInfoAdapter {
request.setPwdResetRequiringSecurityQuestions(platformInfo.isPwdResetRequiringSecurityQuestions());
request.setVersion(platformInfo.getVersion());
request.setCaptchaEnabled(SyncopeEnduserApplication.get().isCaptchaEnabled());
- request.setMaxFileSizeMB(SyncopeEnduserApplication.get().getMaxFileSizeMB());
+ request.setMaxUploadFileSizeMB(SyncopeEnduserApplication.get().getMaxUploadFileSizeMB());
request.setCustomForm(customForm);
return request;
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/PlatformInfoRequest.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/PlatformInfoRequest.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/PlatformInfoRequest.java
index 5480e10..c4daa44 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/PlatformInfoRequest.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/PlatformInfoRequest.java
@@ -35,7 +35,7 @@ public class PlatformInfoRequest implements Serializable {
private boolean captchaEnabled;
- private int maxFileSizeMB;
+ private int maxUploadFileSizeMB;
private Map<String, CustomAttributesInfo> customForm;
@@ -66,8 +66,8 @@ public class PlatformInfoRequest implements Serializable {
this.version = version;
}
- public int getMaxFileSizeMB() {
- return maxFileSizeMB;
+ public int getMaxUploadFileSizeMB() {
+ return maxUploadFileSizeMB;
}
public void setSelfRegAllowed(final boolean selfRegAllowed) {
@@ -86,8 +86,8 @@ public class PlatformInfoRequest implements Serializable {
this.captchaEnabled = captchaEnabled;
}
- public void setMaxFileSizeMB(final int maxFileSizeMB) {
- this.maxFileSizeMB = maxFileSizeMB;
+ public void setMaxUploadFileSizeMB(final int maxUploadFileSizeMB) {
+ this.maxUploadFileSizeMB = maxUploadFileSizeMB;
}
public Map<String, CustomAttributesInfo> getCustomForm() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/app.js b/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
index 2616398..da0aadc 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
+++ b/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
@@ -359,7 +359,7 @@ app.controller('ApplicationController', ['$scope', '$rootScope', '$location', 'I
$rootScope.pwdResetRequiringSecurityQuestions = false;
$rootScope.captchaEnabled = false;
$rootScope.validationEnabled = true;
- $rootScope.maxFileSizeMB = 4;
+ $rootScope.maxUploadFileSizeMB = 5;
$rootScope.saml2idps = {
available: [],
selected: {}
@@ -372,7 +372,7 @@ app.controller('ApplicationController', ['$scope', '$rootScope', '$location', 'I
$rootScope.version = response.version;
$rootScope.pwdResetRequiringSecurityQuestions = response.pwdResetRequiringSecurityQuestions;
$rootScope.captchaEnabled = response.captchaEnabled;
- $rootScope.maxFileSizeMB = response.maxFileSizeMB;
+ $rootScope.maxUploadFileSizeMB = response.maxUploadFileSizeMB;
/*
* USER form customization JSON
*/
@@ -408,8 +408,8 @@ app.controller('ApplicationController', ['$scope', '$rootScope', '$location', 'I
$rootScope.getVersion = function () {
return $rootScope.version;
};
- $rootScope.getMaxFileSizeMB = function () {
- return $rootScope.maxFileSizeMB;
+ $rootScope.getMaxUploadFileSizeMB = function () {
+ return $rootScope.maxUploadFileSizeMB;
};
/*
* USER Attributes sorting strategies
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/client/enduser/src/main/resources/META-INF/resources/app/js/directives/fileInput.js
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/directives/fileInput.js b/client/enduser/src/main/resources/META-INF/resources/app/js/directives/fileInput.js
index d1a173d..4c0db92 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/js/directives/fileInput.js
+++ b/client/enduser/src/main/resources/META-INF/resources/app/js/directives/fileInput.js
@@ -47,7 +47,7 @@ angular.module('self')
initialPreview: [
previewImgComposite
],
- 'maxFileSize': parseInt($rootScope.maxFileSizeMB) * 1000
+ 'maxFileSize': parseInt($rootScope.maxUploadFileSizeMB) * 1000
});
}
};
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/client/enduser/src/main/resources/enduser.properties
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/enduser.properties b/client/enduser/src/main/resources/enduser.properties
index 30a6d0e..dc9bc7e 100644
--- a/client/enduser/src/main/resources/enduser.properties
+++ b/client/enduser/src/main/resources/enduser.properties
@@ -22,7 +22,7 @@ anonymousUser=${anonymousUser}
anonymousKey=${anonymousKey}
adminUser=${adminUser}
useGZIPCompression=true
-maxFileSizeMB=4
+maxUploadFileSizeMB=5
scheme=http
host=localhost
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/fit/console-reference/src/main/resources/console.properties
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/main/resources/console.properties b/fit/console-reference/src/main/resources/console.properties
index 8774724..ba3bd82 100644
--- a/fit/console-reference/src/main/resources/console.properties
+++ b/fit/console-reference/src/main/resources/console.properties
@@ -26,7 +26,7 @@ host=localhost
port=9080
rootPath=/syncope/rest/
useGZIPCompression=true
-maxFileSizeMB=5
+maxUploadFileSizeMB=5
csrf=true
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/fit/core-reference/src/test/resources/console.properties
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/resources/console.properties b/fit/core-reference/src/test/resources/console.properties
index a4be654..158fa0e 100644
--- a/fit/core-reference/src/test/resources/console.properties
+++ b/fit/core-reference/src/test/resources/console.properties
@@ -26,7 +26,7 @@ host=localhost
port=9080
rootPath=/syncope/rest/
useGZIPCompression=true
-maxFileSizeMB=5
+maxUploadFileSizeMB=5
csrf=false
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/fit/enduser-reference/src/main/resources/enduser.properties
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/main/resources/enduser.properties b/fit/enduser-reference/src/main/resources/enduser.properties
index 6e90d65..b7edda1 100644
--- a/fit/enduser-reference/src/main/resources/enduser.properties
+++ b/fit/enduser-reference/src/main/resources/enduser.properties
@@ -22,7 +22,7 @@ anonymousUser=${anonymousUser}
anonymousKey=${anonymousKey}
adminUser=${adminUser}
useGZIPCompression=true
-maxFileSizeMB=4
+maxUploadFileSizeMB=5
scheme=http
host=localhost
http://git-wip-us.apache.org/repos/asf/syncope/blob/0155bba1/fit/enduser-reference/src/test/resources/enduser.properties
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/test/resources/enduser.properties b/fit/enduser-reference/src/test/resources/enduser.properties
index a906d15..ed2d5cd 100644
--- a/fit/enduser-reference/src/test/resources/enduser.properties
+++ b/fit/enduser-reference/src/test/resources/enduser.properties
@@ -22,7 +22,7 @@ anonymousUser=${anonymousUser}
anonymousKey=${anonymousKey}
adminUser=${adminUser}
useGZIPCompression=true
-maxFileSizeMB=4
+maxUploadFileSizeMB=5
scheme=http
host=localhost