From 87600aff054cf60a1d6e272b0d993d852aaf4763 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 8 Nov 2013 09:02:09 +0100 Subject: BugFixes: --LoginFormPreview: Header text UTF8 encoding error --PVP2 Login: do not show loginbutton in case of PVP2 login is not enabled --- .../config/ConfigurationProvider.java | 6 +++--- .../configuration/struts/action/EditOAAction.java | 12 ++++++++++- .../configuration/struts/action/IndexAction.java | 24 ++++++++++++++++++++-- 3 files changed, 36 insertions(+), 6 deletions(-) (limited to 'id/ConfigWebTool/src/main/java/at') diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java index 2b6c326eb..fb468967c 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java @@ -138,9 +138,9 @@ public class ConfigurationProvider { return Integer.getInteger(delay, 12); } - public String getContactMailAddress() { - return props.getProperty("general.contact.mail"); - } +// public String getContactMailAddress() { +// return props.getProperty("general.contact.mail"); +// } public String getSSOLogOutURL() { return props.getProperty("general.login.pvp2.idp.sso.logout.url"); 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 56d6ba9d7..04b4da19a 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 @@ -1,12 +1,13 @@ package at.gv.egovernment.moa.id.configuration.struts.action; +import iaik.utils.URLDecoder; + import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.math.BigInteger; -import java.net.URI; import java.security.cert.CertificateException; import java.util.ArrayList; import java.util.Date; @@ -18,6 +19,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.apache.struts2.interceptor.ServletRequestAware; import org.apache.struts2.interceptor.ServletResponseAware; @@ -66,6 +68,7 @@ import at.gv.egovernment.moa.id.configuration.validation.oa.OASAML1ConfigValidat import at.gv.egovernment.moa.id.configuration.validation.oa.OASSOConfigValidation; import at.gv.egovernment.moa.id.configuration.validation.oa.OASTORKConfigValidation; import at.gv.egovernment.moa.id.util.FormBuildUtils; +import at.gv.egovernment.moa.id.util.HTTPUtils; import at.gv.egovernment.moa.id.util.Random; import at.gv.egovernment.moa.util.MiscUtil; @@ -667,9 +670,16 @@ ServletResponseAware { Map map = (Map) mapobj; + request.setCharacterEncoding("UTF-8"); + String module = request.getParameter(Constants.REQUEST_FORMCUSTOM_MODULE); String value = request.getParameter(Constants.REQUEST_FORMCUSTOM_VALUE); + if (value != null) { + String[] query = URLDecoder.decode(request.getQueryString()).split("&"); + value = query[1].substring("value=".length()); + } + synchronized (map) { if (MiscUtil.isNotEmpty(module)) { diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/IndexAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/IndexAction.java index 3bf213290..c82746dbc 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/IndexAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/IndexAction.java @@ -88,9 +88,20 @@ public class IndexAction extends ActionSupport implements ServletRequestAware, private String ssologouturl; + private boolean pvp2LoginActiv = false; + public String start() { - - return Constants.STRUTS_SUCCESS; + + try { + ConfigurationProvider config = ConfigurationProvider.getInstance(); + pvp2LoginActiv = config.isPVP2LoginActive(); + return Constants.STRUTS_SUCCESS; + + } catch (ConfigurationException e) { + log.warn("An internal error occurs.", e); + addActionError(LanguageHelper.getErrorString("error.login.internal")); + return Constants.STRUTS_ERROR; + } } public String authenticate() { @@ -809,4 +820,13 @@ public class IndexAction extends ActionSupport implements ServletRequestAware, public void setFormID(String formID) { this.formID = formID; } + + /** + * @return the pvp2LoginActiv + */ + public boolean isPvp2LoginActiv() { + return pvp2LoginActiv; + } + + } -- cgit v1.2.3