Repository: syncope Updated Branches: refs/heads/master cf9a1881e -> a23abdf3e
[SYNCOPE-1213] aligned enduser maxUploadFileSize behavior to console's one Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/a23abdf3 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/a23abdf3 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/a23abdf3 Branch: refs/heads/master Commit: a23abdf3eae907839a64ce7f9f82d6296626f38a Parents: cf9a188 Author: Andrea Patricelli <[email protected]> Authored: Tue Oct 3 08:45:59 2017 +0200 Committer: Andrea Patricelli <[email protected]> Committed: Tue Oct 3 08:46:40 2017 +0200 ---------------------------------------------------------------------- .../syncope/client/enduser/SyncopeEnduserApplication.java | 8 +++++--- .../syncope/client/enduser/adapters/PlatformInfoAdapter.java | 4 +++- .../src/main/resources/META-INF/resources/app/js/app.js | 1 - .../META-INF/resources/app/js/directives/fileInput.js | 2 +- fit/enduser-reference/src/test/resources/enduser.properties | 1 - 5 files changed, 9 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/syncope/blob/a23abdf3/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 2196e11..f918d30 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 maxUploadFileSizeMB; - + private SyncopeClientFactoryBean clientFactory; private Map<String, CustomAttributesInfo> customForm; @@ -121,7 +121,9 @@ public class SyncopeEnduserApplication extends WebApplication implements Seriali Args.notNull(rootPath, "<rootPath>"); String useGZIPCompression = props.getProperty("useGZIPCompression"); Args.notNull(useGZIPCompression, "<useGZIPCompression>"); - maxUploadFileSizeMB = Integer.valueOf(props.getProperty("maxUploadFileSizeMB")); + maxUploadFileSizeMB = props.getProperty("maxUploadFileSizeMB") == null + ? null + : Integer.valueOf(props.getProperty("maxUploadFileSizeMB")); clientFactory = new SyncopeClientFactoryBean(). setAddress(scheme + "://" + host + ":" + port + "/" + rootPath). @@ -272,7 +274,7 @@ public class SyncopeEnduserApplication extends WebApplication implements Seriali public Integer getMaxUploadFileSizeMB() { return maxUploadFileSizeMB; } - + public Map<String, CustomAttributesInfo> getCustomForm() { return customForm; } http://git-wip-us.apache.org/repos/asf/syncope/blob/a23abdf3/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 c169010..a9fcf3c 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,9 @@ public final class PlatformInfoAdapter { request.setPwdResetRequiringSecurityQuestions(platformInfo.isPwdResetRequiringSecurityQuestions()); request.setVersion(platformInfo.getVersion()); request.setCaptchaEnabled(SyncopeEnduserApplication.get().isCaptchaEnabled()); - request.setMaxUploadFileSizeMB(SyncopeEnduserApplication.get().getMaxUploadFileSizeMB()); + if (SyncopeEnduserApplication.get().getMaxUploadFileSizeMB() != null) { + request.setMaxUploadFileSizeMB(SyncopeEnduserApplication.get().getMaxUploadFileSizeMB()); + } request.setCustomForm(customForm); return request; http://git-wip-us.apache.org/repos/asf/syncope/blob/a23abdf3/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 da0aadc..71a3985 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,6 @@ app.controller('ApplicationController', ['$scope', '$rootScope', '$location', 'I $rootScope.pwdResetRequiringSecurityQuestions = false; $rootScope.captchaEnabled = false; $rootScope.validationEnabled = true; - $rootScope.maxUploadFileSizeMB = 5; $rootScope.saml2idps = { available: [], selected: {} http://git-wip-us.apache.org/repos/asf/syncope/blob/a23abdf3/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 4c0db92..50f4a7f 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.maxUploadFileSizeMB) * 1000 + 'maxFileSize': $rootScope.maxUploadFileSizeMB ? parseInt($rootScope.maxUploadFileSizeMB) * 1000 : undefined }); } }; http://git-wip-us.apache.org/repos/asf/syncope/blob/a23abdf3/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 ed2d5cd..7387c0d 100644 --- a/fit/enduser-reference/src/test/resources/enduser.properties +++ b/fit/enduser-reference/src/test/resources/enduser.properties @@ -22,7 +22,6 @@ anonymousUser=${anonymousUser} anonymousKey=${anonymousKey} adminUser=${adminUser} useGZIPCompression=true -maxUploadFileSizeMB=5 scheme=http host=localhost
