← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18788: Moved CORS settings into access settings.

 

------------------------------------------------------------
revno: 18788
committer: Halvdan Hoem Grelland <halvdanhg@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-03-31 17:57:18 +0200
message:
  Moved CORS settings into access settings.
removed:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetRemoteAccessSettingsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetRemoteAccessSettingsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemRemoteAccessSettings.vm
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetAccessSettingsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetAccessSettingsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/index.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/settingsMenu.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemAccessSettings.vm


--
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-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetAccessSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetAccessSettingsAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetAccessSettingsAction.java	2015-03-31 15:57:18 +0000
@@ -35,6 +35,7 @@
 import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.setting.SystemSettingManager;
 import org.hisp.dhis.system.filter.NonCriticalUserAuthorityGroupFilter;
 import org.hisp.dhis.system.util.FilterUtils;
 import org.hisp.dhis.user.UserAuthorityGroup;
@@ -55,6 +56,9 @@
     @Autowired
     private OrganisationUnitService organisationUnitService;
 
+    @Autowired
+    private SystemSettingManager systemSettingManager;
+
     // -------------------------------------------------------------------------
     // Output
     // -------------------------------------------------------------------------
@@ -73,6 +77,13 @@
         return selfRegistrationOrgUnits;
     }
 
+    private List<String> corsWhitelist = new ArrayList<>();
+
+    public List<String> getCorsWhitelist()
+    {
+        return corsWhitelist;
+    }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -87,6 +98,8 @@
         
         selfRegistrationOrgUnits.addAll( organisationUnitService.getOrganisationUnitsAtLevel( 1 ) );
         selfRegistrationOrgUnits.addAll( organisationUnitService.getOrganisationUnitsAtLevel( 2 ) );
+
+        corsWhitelist = systemSettingManager.getCorsWhitelist();
         
         return SUCCESS;        
     }

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetRemoteAccessSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetRemoteAccessSettingsAction.java	2015-01-14 10:06:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetRemoteAccessSettingsAction.java	1970-01-01 00:00:00 +0000
@@ -1,69 +0,0 @@
-package org.hisp.dhis.settings.action.system;
-
-/*
- * Copyright (c) 2004-2015, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import com.opensymphony.xwork2.Action;
-import org.hisp.dhis.setting.SystemSettingManager;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
- */
-public class GetRemoteAccessSettingsAction
-    implements Action
-{
-    @Autowired
-    private SystemSettingManager systemSettingManager;
-
-    // -------------------------------------------------------------------------
-    // Input & Output
-    // -------------------------------------------------------------------------
-
-    private List<String> whitelist = new ArrayList<>();
-
-    public List<String> getWhitelist()
-    {
-        return whitelist;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    @Override
-    public String execute()
-    {
-        whitelist = systemSettingManager.getCorsWhitelist();
-
-        return SUCCESS;
-    }
-}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetAccessSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetAccessSettingsAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetAccessSettingsAction.java	2015-03-31 15:57:18 +0000
@@ -40,6 +40,11 @@
 import org.hisp.dhis.user.UserService;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
 import static org.hisp.dhis.setting.SystemSettingManager.*;
 
 /**
@@ -127,6 +132,13 @@
         this.openIdProviderLabel = openIdProviderLabel;
     }
 
+    private List<String> corsWhitelist = new ArrayList<>();
+
+    public void setCorsWhitelist( ArrayList<String> corsWhitelist )
+    {
+        this.corsWhitelist = corsWhitelist;
+    }
+
     // -------------------------------------------------------------------------
     // Output
     // -------------------------------------------------------------------------
@@ -187,6 +199,8 @@
             systemSettingManager.saveSystemSetting( KEY_CREDENTIALS_EXPIRES, credentialsExpires );
         }
 
+        systemSettingManager.saveSystemSetting( SystemSettingManager.KEY_CORS_WHITELIST, (Serializable) corsWhitelist );
+
         message = i18n.getString( "settings_updated" );
 
         return SUCCESS;

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetRemoteAccessSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetRemoteAccessSettingsAction.java	2015-01-14 10:06:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetRemoteAccessSettingsAction.java	1970-01-01 00:00:00 +0000
@@ -1,87 +0,0 @@
-package org.hisp.dhis.settings.action.system;
-
-/*
- * Copyright (c) 2004-2015, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import com.opensymphony.xwork2.Action;
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.setting.SystemSettingManager;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
- */
-public class SetRemoteAccessSettingsAction
-    implements Action
-{
-    @Autowired
-    private SystemSettingManager systemSettingManager;
-
-    // -------------------------------------------------------------------------
-    // Input & Output
-    // -------------------------------------------------------------------------
-
-    private String message;
-
-    public String getMessage()
-    {
-        return message;
-    }
-
-    private I18n i18n;
-
-    public void setI18n( I18n i18n )
-    {
-        this.i18n = i18n;
-    }
-
-    private List<String> whitelist = new ArrayList<>();
-
-    public void setWhitelist( List<String> whitelist )
-    {
-        this.whitelist = whitelist;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    @Override
-    public String execute()
-    {
-        message = i18n.getString( "settings_updated" );
-
-        systemSettingManager.saveSystemSetting( SystemSettingManager.KEY_CORS_WHITELIST, (Serializable) whitelist );
-
-        return SUCCESS;
-    }
-}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/META-INF/dhis/beans.xml	2015-01-14 03:56:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/META-INF/dhis/beans.xml	2015-03-31 15:57:18 +0000
@@ -65,18 +65,10 @@
     class="org.hisp.dhis.settings.action.system.GetAccessSettingsAction"
     scope="prototype" />
 
-  <bean id="org.hisp.dhis.settings.action.system.GetRemoteAccessSettingsAction"
-    class="org.hisp.dhis.settings.action.system.GetRemoteAccessSettingsAction"
-    scope="prototype" />
-
   <bean id="org.hisp.dhis.settings.action.system.SetAccessSettingsAction"
     class="org.hisp.dhis.settings.action.system.SetAccessSettingsAction"
     scope="prototype" />
 
-  <bean id="org.hisp.dhis.settings.action.system.SetRemoteAccessSettingsAction"
-    class="org.hisp.dhis.settings.action.system.SetRemoteAccessSettingsAction"
-    scope="prototype" />
-
   <bean id="org.hisp.dhis.settings.action.system.GetApprovalSettingsAction"
     class="org.hisp.dhis.settings.action.system.GetApprovalSettingsAction"
     scope="prototype">

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties	2015-03-31 12:34:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties	2015-03-31 15:57:18 +0000
@@ -76,7 +76,7 @@
 phone_number_area_code = Phone number area code
 google_analytics_ua_key=Google Analytics (Universal Analytics) key
 application_introduction=Application introduction
-remote_access_settings=Remote Access settings
+remote_access_settings=Remote Access Settings
 do_not_allow_self_registration=Do not allow self registration
 do_not_require_recaptcha_for_self_registration=Do not require recaptcha for self registration
 self_registration_account_user_role=Self registration account user role

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/struts.xml	2015-01-14 03:56:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/struts.xml	2015-03-31 15:57:18 +0000
@@ -104,23 +104,6 @@
       <param name="requiredAuthorities">F_SYSTEM_SETTING</param>
     </action>
 
-    <!-- Remote Access settings -->
-
-    <action name="systemRemoteAccessSettings" class="org.hisp.dhis.settings.action.system.GetRemoteAccessSettingsAction">
-      <result name="success" type="velocity">/main.vm</result>
-      <param name="page">/dhis-web-maintenance-settings/systemRemoteAccessSettings.vm</param>
-      <param name="menu">/dhis-web-maintenance-settings/settingsMenu.vm</param>
-      <param name="requiredAuthorities">F_SYSTEM_SETTING</param>
-    </action>
-
-    <action name="setSystemRemoteAccessSettings" class="org.hisp.dhis.settings.action.system.SetRemoteAccessSettingsAction">
-      <result name="success" type="velocity-json">
-        /dhis-web-commons/ajax/jsonResponseSuccess.vm
-      </result>
-      <param name="onExceptionReturn">plainTextError</param>
-      <param name="requiredAuthorities">F_SYSTEM_SETTING</param>
-    </action>
-
     <!-- Approval settings -->
 
     <action name="systemApprovalSettings" class="org.hisp.dhis.settings.action.system.GetApprovalSettingsAction">

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/index.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/index.vm	2015-01-14 03:56:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/index.vm	2015-03-31 15:57:18 +0000
@@ -8,5 +8,4 @@
     #introListImgItem( "systemApprovalSettings.action" "approval_settings" "systemsettings" )
     #introListImgItem( "systemCalendarSettings.action" "calendar_settings" "systemsettings" )
     #introListImgItem( "systemSynchronizationSettings.action" "data_synchronization" "systemsettings" )
-    #introListImgItem( "systemAccessSettings.action" "remote_access_settings" "systemsettings" )
 </ul>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/settingsMenu.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/settingsMenu.vm	2015-01-14 03:56:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/settingsMenu.vm	2015-03-31 15:57:18 +0000
@@ -7,5 +7,4 @@
   <li><a href="systemApprovalSettings.action">$i18n.getString( "approval" )&nbsp;</a></li>
   <li><a href="systemCalendarSettings.action">$i18n.getString( "calendar" )&nbsp;</a></li>
   <li><a href="systemSynchronizationSettings.action">$i18n.getString( "synchronization" )&nbsp;</a></li>
-  <li><a href="systemRemoteAccessSettings.action">$i18n.getString( "remote_access" )&nbsp;</a></li>
 </ul>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemAccessSettings.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemAccessSettings.vm	2014-11-24 18:14:38 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemAccessSettings.vm	2015-03-31 15:57:18 +0000
@@ -1,23 +1,52 @@
 <script type="text/javascript">
 jQuery( document ).ready( function() {
     jQuery( "input[type=button]" ).click( function() {
-        jQuery.postUTF8( "setSystemAccessSettings.action", {
-            selfRegistrationRole: jQuery( "#selfRegistrationRole" ).val(),
-            selfRegistrationOrgUnit: jQuery( "#selfRegistrationOrgUnit" ).val(),
-            selfRegistrationNoRecaptcha: jQuery( '#selfRegistrationNoRecaptcha' ).is( ':checked' ),
-            accountRecovery: jQuery( '#accountRecovery' ).is( ':checked' ),
-            accountInvite: jQuery( '#accountInvite' ).is( ':checked' ),
-            canGrantOwnUserAuthorityGroups: jQuery( '#canGrantOwnUserAuthorityGroups' ).is( ':checked' ),
-            credentialsExpires: jQuery( '#credentialsExpires' ).val(),
-            openIdProvider: jQuery( '#openIdProvider' ).val(),
-            openIdProviderLabel: jQuery( '#openIdProviderLabel' ).val()
-        }, function( json ) {
-            if ( json.response == "success" ) {
-                setHeaderDelayMessage( json.message );
+
+        var getCorsWhitelist = function() {
+            jQuery( '#corsWhitelist' ).children().attr( 'selected', true );
+            var options = [];
+            jQuery( '#corsWhitelist option' ).each( function( i, option ) {
+                options.push( jQuery( option ).val() );
+            } );
+            return options;
+        };
+
+        $.ajax( {
+            url: 'setSystemAccessSettings.action',
+            type:'post',
+            contentType:'application/x-www-form-urlencoded;charset=utf-8',
+            traditional: true,
+            data: {
+                selfRegistrationRole: jQuery( "#selfRegistrationRole" ).val(),
+                selfRegistrationOrgUnit: jQuery( "#selfRegistrationOrgUnit" ).val(),
+                selfRegistrationNoRecaptcha: jQuery( '#selfRegistrationNoRecaptcha' ).is( ':checked' ),
+                accountRecovery: jQuery( '#accountRecovery' ).is( ':checked' ),
+                accountInvite: jQuery( '#accountInvite' ).is( ':checked' ),
+                canGrantOwnUserAuthorityGroups: jQuery( '#canGrantOwnUserAuthorityGroups' ).is( ':checked' ),
+                credentialsExpires: jQuery( '#credentialsExpires' ).val(),
+                openIdProvider: jQuery( '#openIdProvider' ).val(),
+                openIdProviderLabel: jQuery( '#openIdProviderLabel' ).val(),
+                corsWhitelist: getCorsWhitelist()
+            },
+        } ).done( function( res ) {
+            if( res.response == "success" ) {
+                setHeaderDelayMessage(res.message);
             }
         } );
     } );
-} );    
+
+    jQuery( '#add-domain' ).on( 'click', function( e ) {
+        var domainText = $( '#domain' ).val();
+
+        if( domainText && domainText.length > 0 ) {
+            $( '<option/>' ).attr( 'value', domainText ).text( domainText ).appendTo( '#corsWhitelist' );
+        }
+    } );
+
+    jQuery( '#del-domain' ).on('click', function( e ) {
+        $( '#corsWhitelist option:selected' ).remove();
+    } );
+} );
 </script>
 
 #set( $curRole = $keyConfig.selfRegistrationRole )
@@ -29,8 +58,8 @@
 
 <div class="setting">
 <select id="selfRegistrationRole" name="selfRegistrationRole">
-	<option>$i18n.getString( "do_not_allow_self_registration" )</option>
-	<option>---</option>
+    <option>$i18n.getString( "do_not_allow_self_registration" )</option>
+    <option>---</option>
     #foreach( $role in $userRoles )
     <option value="$role.id" #if( $curRole && $role.id == $curRole.id )selected="selected"#end>$encoder.htmlEncode( $role.name )</option>
     #end
@@ -38,15 +67,15 @@
 </div>
 
 <div class="setting">
-	<input type="checkbox" id="selfRegistrationNoRecaptcha" name="selfRegistrationNoRecaptcha"#if( $keySelfRegistrationNoRecaptcha ) checked="checked"#end>
-	<label for="selfRegistrationNoRecaptcha">$i18n.getString( "do_not_require_recaptcha_for_self_registration" )</label>
+    <input type="checkbox" id="selfRegistrationNoRecaptcha" name="selfRegistrationNoRecaptcha"#if( $keySelfRegistrationNoRecaptcha ) checked="checked"#end>
+    <label for="selfRegistrationNoRecaptcha">$i18n.getString( "do_not_require_recaptcha_for_self_registration" )</label>
 </div>
 
 <div class="settingLabel">$i18n.getString( "self_registration_account_organisation_unit" )</div>
 
 <div class="setting">
 <select id="selfRegistrationOrgUnit" name="selfRegistrationOrgUnit">
-	<option value="">[ $i18n.getString( "select_organisation_unit" ) ]</option>
+    <option value="">[ $i18n.getString( "select_organisation_unit" ) ]</option>
     #foreach( $unit in $selfRegistrationOrgUnits )
     <option value="$unit.id" #if( $curUnit && $unit.id == $curUnit.id )selected="selected"#end>$encoder.htmlEncode( $unit.name )</option>
     #end
@@ -72,10 +101,10 @@
 
 <div class="setting">
 <select id="credentialsExpires" name="credentialsExpires">
-	<option value="0">[ $i18n.getString( "never" ) ]</option>
-	<option value="3" #if( $credentialsExpires == 3 )selected="selected"#end>3 $i18n.getString( "months" )</option>
-	<option value="6" #if( $credentialsExpires == 6 )selected="selected"#end>6 $i18n.getString( "months" )</option>
-	<option value="12" #if( $credentialsExpires == 12 )selected="selected"#end>12 $i18n.getString( "months" )</option>
+    <option value="0">[ $i18n.getString( "never" ) ]</option>
+    <option value="3" #if( $credentialsExpires == 3 )selected="selected"#end>3 $i18n.getString( "months" )</option>
+    <option value="6" #if( $credentialsExpires == 6 )selected="selected"#end>6 $i18n.getString( "months" )</option>
+    <option value="12" #if( $credentialsExpires == 12 )selected="selected"#end>12 $i18n.getString( "months" )</option>
 </select>
 </div>
 
@@ -91,4 +120,19 @@
     <input type="text" id="openIdProviderLabel" name="openIdLabel" value="$!keyOpenIdProviderLabel">
 </div>
 
+<div class="settingLabel">$i18n.getString( "cors_whitelist" )</div>
+
+<div class="setting">
+    <input type="text" id="domain" name="domain">
+    <button id="add-domain" style="width:70px">$i18n.getString( "add" )</button>
+    <button id="del-domain" style="width:70px">$i18n.getString( "remove" )</button>
+
+    <br/>
+    <select id="corsWhitelist" name="corsWhitelist" multiple="multiple">
+        #foreach( $domain in $corsWhitelist )
+            <option value="$domain">$domain</option>
+        #end
+    </select>
+</div>
+
 <div class="setting"><input type="button" value="$i18n.getString( 'save' )" style="width:10em"/></div>

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemRemoteAccessSettings.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemRemoteAccessSettings.vm	2015-01-20 13:24:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemRemoteAccessSettings.vm	1970-01-01 00:00:00 +0000
@@ -1,48 +0,0 @@
-<script type="text/javascript">
-  $(document).ready(function() {
-    $("input[type=button]").click(function() {
-      $('#whitelist').children().attr('selected', true);
-
-      $.ajax({
-        url: 'setSystemRemoteAccessSettings.action',
-        type: 'POST',
-        data: $('#whitelist').serialize()
-      }).done(function( res ) {
-        if( res.response == "success" ) {
-          setHeaderDelayMessage(res.message);
-        }
-      });
-    });
-
-    $('#add-domain').on('click', function( e ) {
-      var domainText = $('#domain').val();
-
-      if( domainText && domainText.length > 0 ) {
-        $('<option/>').attr('value', domainText).text(domainText).appendTo('#whitelist');
-      }
-    });
-
-    $('#del-domain').on('click', function( e ) {
-      $("#whitelist option:selected").remove();
-    });
-  });
-</script>
-
-<h3>$i18n.getString( "remote_access_settings" )</h3>
-
-<div class="settingLabel">$i18n.getString( "cors_whitelist" )</div>
-
-<div class="setting">
-  <input type="text" id="domain" name="domain">
-  <button id="add-domain" style="width:70px">$i18n.getString( "add" )</button>
-  <button id="del-domain" style="width:70px">$i18n.getString( "remove" )</button>
-
-  <br/>
-  <select id="whitelist" name="whitelist" multiple="multiple">
-    #foreach( $domain in $whitelist )
-      <option value="$domain">$domain</option>
-    #end
-  </select>
-</div>
-
-<div class="setting"><input type="button" value="$i18n.getString( 'save' )" style="width:10em"/></div>