syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreapatrice...@apache.org
Subject syncope git commit: [SYNCOPE-1213] aligned enduser maxUploadFileSize behavior to console's one
Date Tue, 03 Oct 2017 06:46:15 GMT
Repository: syncope
Updated Branches:
  refs/heads/2_0_X 0155bba1c -> 271451d51


[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/271451d5
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/271451d5
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/271451d5

Branch: refs/heads/2_0_X
Commit: 271451d51a091031bf76cfc6710a6f271f582aa9
Parents: 0155bba
Author: Andrea Patricelli <andreapatricelli@apache.org>
Authored: Tue Oct 3 08:45:59 2017 +0200
Committer: Andrea Patricelli <andreapatricelli@apache.org>
Committed: Tue Oct 3 08:45:59 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/271451d5/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 dcf3a25..21e9e5f 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
@@ -84,7 +84,7 @@ public class SyncopeEnduserApplication extends WebApplication implements
Seriali
     private boolean xsrfEnabled;
 
     private Integer maxUploadFileSizeMB;
-    
+
     private SyncopeClientFactoryBean clientFactory;
 
     private Map<String, CustomAttributesInfo> customForm;
@@ -122,7 +122,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).
@@ -284,7 +286,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/271451d5/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/271451d5/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/271451d5/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/271451d5/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


Mime
View raw message