← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20744: ConfigurationController, trim to null

 

------------------------------------------------------------
revno: 20744
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-10-16 14:50:37 +0200
message:
  ConfigurationController, trim to null
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ConfigurationController.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ConfigurationController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ConfigurationController.java	2015-10-16 09:49:16 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ConfigurationController.java	2015-10-16 12:50:37 +0000
@@ -33,6 +33,7 @@
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.commons.lang.StringUtils;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.IdentifiableObjectManager;
 import org.hisp.dhis.configuration.Configuration;
@@ -299,7 +300,7 @@
     {
         Configuration config = configurationService.getConfiguration();
         
-        config.setSmtpPassword( password );
+        config.setSmtpPassword( StringUtils.trimToNull( password ) );
         
         configurationService.setConfiguration( config );
     }    
@@ -317,7 +318,7 @@
     {
         Configuration config = configurationService.getConfiguration();
         
-        config.setRemoteServerUrl( url );
+        config.setRemoteServerUrl( StringUtils.trimToNull( url ) );
         
         configurationService.setConfiguration( config );
     }
@@ -335,7 +336,7 @@
     {
         Configuration config = configurationService.getConfiguration();
         
-        config.setRemoteServerUsername( username );
+        config.setRemoteServerUsername( StringUtils.trimToNull( username ) );
         
         configurationService.setConfiguration( config );
     }
@@ -347,7 +348,7 @@
     {
         Configuration config = configurationService.getConfiguration();
         
-        config.setRemoteServerPassword( password );
+        config.setRemoteServerPassword( StringUtils.trimToNull( password ) );
         
         configurationService.setConfiguration( config );
     }