=== 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 corsWhitelist = new ArrayList<>(); + + public List 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 - */ -public class GetRemoteAccessSettingsAction - implements Action -{ - @Autowired - private SystemSettingManager systemSettingManager; - - // ------------------------------------------------------------------------- - // Input & Output - // ------------------------------------------------------------------------- - - private List whitelist = new ArrayList<>(); - - public List 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 corsWhitelist = new ArrayList<>(); + + public void setCorsWhitelist( ArrayList 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 - */ -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 whitelist = new ArrayList<>(); - - public void setWhitelist( List 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" /> - - - - === 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 @@ F_SYSTEM_SETTING - - - - /main.vm - /dhis-web-maintenance-settings/systemRemoteAccessSettings.vm - /dhis-web-maintenance-settings/settingsMenu.vm - F_SYSTEM_SETTING - - - - - /dhis-web-commons/ajax/jsonResponseSuccess.vm - - plainTextError - F_SYSTEM_SETTING - - === 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" ) === 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 @@
  • $i18n.getString( "approval" ) 
  • $i18n.getString( "calendar" ) 
  • $i18n.getString( "synchronization" ) 
  • -
  • $i18n.getString( "remote_access" ) 
  • === 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 @@ #set( $curRole = $keyConfig.selfRegistrationRole ) @@ -29,8 +58,8 @@
    - + +
    $i18n.getString( "self_registration_account_organisation_unit" )
    - - - - + + + +
    @@ -91,4 +120,19 @@ +
    $i18n.getString( "cors_whitelist" )
    + +
    + + + + +
    + +
    +
    === 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 @@ - - -

    $i18n.getString( "remote_access_settings" )

    - -
    $i18n.getString( "cors_whitelist" )
    - -
    - - - - -
    - -
    - -