diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2013-08-09 11:01:40 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2013-08-09 11:01:40 +0200 |
commit | 45e170310a012dca93d5e5d4dc0b54e6b0808e95 (patch) | |
tree | 9bea65102edd41a0c9d87700bd89fdd67616dd86 /id/ConfigWebTool/src | |
parent | 085e28a515520656a281634297d399d550eb3898 (diff) | |
download | moa-id-spss-45e170310a012dca93d5e5d4dc0b54e6b0808e95.tar.gz moa-id-spss-45e170310a012dca93d5e5d4dc0b54e6b0808e95.tar.bz2 moa-id-spss-45e170310a012dca93d5e5d4dc0b54e6b0808e95.zip |
BugFixes:
>>PVP2 Metadata:
- Load OA only if Authentication is required
- Load Metadata enityID from Database
>>LegacyConfigParser
- Solve problems if no OnlineMandate or STORK config is included
- try to load DefaultBKUURLs from TrustedBKUs
- if old MOA-ID 2.x config exists, use this DefaultBKUs to import OnlineApplications
>> ConfigurationTool
- change LayOut
Diffstat (limited to 'id/ConfigWebTool/src')
8 files changed, 82 insertions, 54 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java index a58b20214..d90e6f9b1 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java @@ -1,6 +1,7 @@ package at.gv.egovernment.moa.id.configuration.filter; import java.io.IOException; +import java.io.PrintWriter; import java.util.ArrayList; import java.util.StringTokenizer; import java.util.regex.Pattern; @@ -173,8 +174,19 @@ public class AuthenticationFilter implements Filter{ } } + try { + filterchain.doFilter(req, resp); - filterchain.doFilter(req, resp); + } catch (Exception e) { + + String redirectURL = "./index.action"; + HttpServletResponse httpResp = (HttpServletResponse) resp; + redirectURL = httpResp.encodeRedirectURL(redirectURL); + resp.setContentType("text/html"); + ((HttpServletResponse) resp).setStatus(302); + httpResp.addHeader("Location", redirectURL); + log.warn("A Filter Error occurs -> Redirect to Login-Form"); + } } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java index 96918d37c..7be62d362 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java @@ -178,6 +178,8 @@ ServletResponseAware { errors.add(LanguageHelper.getErrorString("validation.general.oaidentifier.empty")); } else { + + //TODO: oaidentifier has to be a URL according to PVP2.1 specification if (ValidationHelper.isValidOAIdentifier(oaidentifier)) { log.warn("IdentificationNumber contains potentail XSS characters: " + oaidentifier); errors.add(LanguageHelper.getErrorString("validation.general.oaidentifier.valid", diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ImportExportAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ImportExportAction.java index a8992e6b8..b683a95f9 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ImportExportAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ImportExportAction.java @@ -103,34 +103,42 @@ implements ServletRequestAware, ServletResponseAware { return Constants.STRUTS_ERROR_VALIDATION; } log.debug("OpenSAML successfully initialized"); - - - MOAIDConfiguration moaconfig; try { - log.warn("WARNING! The legacy import deletes the hole old config"); - - List<OnlineApplication> oas = ConfigurationDBRead.getAllOnlineApplications(); - if (oas != null && oas.size() > 0) { - for (OnlineApplication oa : oas) - ConfigurationDBUtils.delete(oa); - } + + MOAIDConfiguration moaidconfig = ConfigurationDBRead.getMOAIDConfiguration(); - - moaconfig = BuildFromLegacyConfig.build(fileUpload, ""); + MOAIDConfiguration moaconfig; + try { + log.warn("WARNING! The legacy import deletes the hole old config"); + + moaconfig = BuildFromLegacyConfig.build(fileUpload, "", moaidconfig); - } catch (ConfigurationException e) { - log.info("Legacy configuration has an Import Error", e); - addActionError(LanguageHelper.getErrorString("errors.importexport.legacyimport", new Object[] {e.getMessage()})); - return Constants.STRUTS_ERROR_VALIDATION; - } + } catch (ConfigurationException e) { + log.info("Legacy configuration has an Import Error", e); + addActionError(LanguageHelper.getErrorString("errors.importexport.legacyimport", new Object[] {e.getMessage()})); + ConfigurationDBUtils.closeSession(); + return Constants.STRUTS_ERROR_VALIDATION; + } //check if XML config should be use log.warn("WARNING! MOA-ID 2.0 is started with XML configuration. This setup overstrike the actual configuration in the Database!"); - try { - MOAIDConfiguration moaidconfig = ConfigurationDBRead.getMOAIDConfiguration(); + + if (moaidconfig != null) ConfigurationDBUtils.delete(moaidconfig); + + List<OnlineApplication> oas = ConfigurationDBRead.getAllOnlineApplications(); + if (oas != null && oas.size() > 0) { + for (OnlineApplication oa : oas) + ConfigurationDBUtils.delete(oa); + } + + oas = moaconfig.getOnlineApplication(); + for (OnlineApplication oa : oas) + ConfigurationDBUtils.save(oa); + + moaconfig.setOnlineApplication(null); ConfigurationDBUtils.save(moaconfig); } catch (MOADatabaseException e) { @@ -227,19 +235,7 @@ implements ServletRequestAware, ServletResponseAware { addActionError(LanguageHelper.getErrorString("errors.importexport.nofile")); return Constants.STRUTS_ERROR_VALIDATION; } - - log.warn("WARNING! The XML import deletes the hole old config"); - - List<OnlineApplication> oas = ConfigurationDBRead.getAllOnlineApplications(); - if (oas != null && oas.size() > 0) { - for (OnlineApplication oa : oas) - ConfigurationDBUtils.delete(oa); - } - MOAIDConfiguration moaidconfig = ConfigurationDBRead.getMOAIDConfiguration(); - if (moaidconfig != null) - ConfigurationDBUtils.delete(moaidconfig); - - + log.info("Load configuration from MOA-ID 2.x XML configuration"); try { @@ -247,6 +243,17 @@ implements ServletRequestAware, ServletResponseAware { Unmarshaller m = jc.createUnmarshaller(); MOAIDConfiguration moaconfig = (MOAIDConfiguration) m.unmarshal(fileUpload); + + log.warn("WARNING! The XML import deletes the hole old config"); + List<OnlineApplication> oas = ConfigurationDBRead.getAllOnlineApplications(); + if (oas != null && oas.size() > 0) { + for (OnlineApplication oa : oas) + ConfigurationDBUtils.delete(oa); + } + MOAIDConfiguration moaidconfig = ConfigurationDBRead.getMOAIDConfiguration(); + if (moaidconfig != null) + ConfigurationDBUtils.delete(moaidconfig); + List<OnlineApplication> importoas = moaconfig.getOnlineApplication(); for (OnlineApplication importoa : importoas) { ConfigurationDBUtils.saveOrUpdate(importoa); diff --git a/id/ConfigWebTool/src/main/resources/applicationResources.properties b/id/ConfigWebTool/src/main/resources/applicationResources.properties index 9ceaa75b3..46f591cb3 100644 --- a/id/ConfigWebTool/src/main/resources/applicationResources.properties +++ b/id/ConfigWebTool/src/main/resources/applicationResources.properties @@ -139,7 +139,7 @@ webpages.oaconfig.general.bku.online=Online BKU webpages.oaconfig.general.bku.handy=Handy BKU webpages.oaconfig.general.bku.slversion=SecurityLayer Version webpages.oaconfig.general.bku.keyboxidentifier=KeyBoxIdentifier -webpages.oaconfig.general.identification=Eindeutiger Identifikatior +webpages.oaconfig.general.identification=Eindeutiger Identifikatior (PublicURLPrefix) webpages.oaconfig.general.mandate.header=Vollmachten webpages.oaconfig.general.mandate.profiles=Profile webpages.oaconfig.general.friendlyname=Name der Online-Applikation diff --git a/id/ConfigWebTool/src/main/resources/struts.xml b/id/ConfigWebTool/src/main/resources/struts.xml index a729f5f57..3b33bffcb 100644 --- a/id/ConfigWebTool/src/main/resources/struts.xml +++ b/id/ConfigWebTool/src/main/resources/struts.xml @@ -29,7 +29,7 @@ <result name="success" type="redirectAction"> <param name="actionName">index</param> <param name="namespace">/</param> - </result> + </result> <interceptor-ref name="defaultStack"/> </action> diff --git a/id/ConfigWebTool/src/main/webapp/css/index.css b/id/ConfigWebTool/src/main/webapp/css/index.css index 49e9f41d1..6eeb6a4ee 100644 --- a/id/ConfigWebTool/src/main/webapp/css/index.css +++ b/id/ConfigWebTool/src/main/webapp/css/index.css @@ -1,9 +1,14 @@ @CHARSET "UTF-8"; #header_area { - height: 40px; - background-color: green; + padding-bottom: 10px; + background-color: #6FA5D4; display: block; + font-size: 20px; + /* margin-left: 25px; */ + padding-top: 10px; + padding-left: 25px; + border-radius: 3px; } #header_area>div { @@ -26,9 +31,11 @@ margin-left: 15px; position: relative; padding-left: 15px; + padding-top: 10px; float: left; - background-color: gray; - + /* background-color: gray; */ + background-color: #CACACA; + border-radius: 5px; } .menu_element { @@ -36,7 +43,8 @@ margin-bottom: 15px; font-size: 20px; display: block; - background-color: red; +/* background-color: red; */ + background-color: #6FA5D4; margin-right: 18px; margin-top: 5px; height: 30px; @@ -165,13 +173,13 @@ padding-right: 10px; padding-top: 3px; text-align: right; - width: 250px; + width: 300px; } .wwctrl { float: left; padding-bottom: 5px; - padding-top: 5px; + padding-top: 1px; text-align: left; } @@ -273,18 +281,17 @@ div .wwgrp br { } #footer_area { - background-color: green; + background-color: #6FA5D4; clear: both; display: block; - height: 40px; +/* height: 40px; */ + padding-bottom: 10px; margin-top: 15px; padding-left: 30px; position: relative; top: 15px; -} - -#footer_area>p { - font-size: 20px; - text-align: center; - padding-top: 8px; + font-size: 20px; + text-align: center; + padding-top: 10px; + border-radius: 3px; } diff --git a/id/ConfigWebTool/src/main/webapp/jsp/snippets/footer.jsp b/id/ConfigWebTool/src/main/webapp/jsp/snippets/footer.jsp index a0f12eed4..3f00984f2 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/snippets/footer.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/snippets/footer.jsp @@ -4,6 +4,6 @@ <html> <div id="footer_area"> - <p>MOA-ID 2.x Configuration Tool</p> + MOA-ID 2.x Konfigurations-Tool </div> </html>
\ No newline at end of file diff --git a/id/ConfigWebTool/src/main/webapp/jsp/snippets/header_userinfos.jsp b/id/ConfigWebTool/src/main/webapp/jsp/snippets/header_userinfos.jsp index 56fcf9681..72affde79 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/snippets/header_userinfos.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/snippets/header_userinfos.jsp @@ -4,14 +4,14 @@ <html> <div id="header_area"> - <div><%=LanguageHelper.getGUIString("webpages.header.info", request) %> +<!-- <div> --> + <%=LanguageHelper.getGUIString("webpages.header.info", request) %> <s:property value="authUser.givenName"/> <s:property value="authUser.familyName"/>, <%=LanguageHelper.getGUIString("webpages.header.lastlogin", request) %> <s:property value="authUser.lastLogin"/> <s:url action="logout" var="logoutURL" namespace="/"/> <a id="logoutbutton" href="<s:property value="#logoutURL" />"><%=LanguageHelper.getGUIString("webpages.index.logout", request) %></a> - </div> +<!-- </div> --> - </div> </html>
\ No newline at end of file |