From a7d5d5035bae5a8de9691b6ec6fe860726efe003 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Wed, 11 Dec 2013 12:24:23 +0100 Subject: login template respects OA configuration --- .../gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java | 3 ++- .../moa/id/auth/builder/SendAssertionFormBuilder.java | 3 ++- .../at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java | 9 +++++++++ .../java/at/gv/egovernment/moa/id/util/FormBuildUtils.java | 11 ++++++++++- .../src/main/resources/resources/templates/loginFormFull.html | 2 +- 5 files changed, 24 insertions(+), 4 deletions(-) (limited to 'id/server/idserverlib') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java index a00ae4ccf..cad8857a6 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java @@ -114,7 +114,8 @@ public class LoginFormBuilder { value = FormBuildUtils.customiceLayoutBKUSelection(value, oaParam.isShowMandateCheckBox(), oaParam.isOnlyMandateAllowed(), - oaParam.getFormCustomizaten()); + oaParam.getFormCustomizaten(), + oaParam.isShowStorkLogin()); } return value; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SendAssertionFormBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SendAssertionFormBuilder.java index b763afd65..49bdf3bbd 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SendAssertionFormBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SendAssertionFormBuilder.java @@ -101,7 +101,8 @@ public class SendAssertionFormBuilder { value = FormBuildUtils.customiceLayoutBKUSelection(value, oaParam.isShowMandateCheckBox(), oaParam.isOnlyMandateAllowed(), - oaParam.getFormCustomizaten()); + oaParam.getFormCustomizaten(), + oaParam.isShowStorkLogin()); } return value; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java index 3c4234114..3edb3cad9 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java @@ -263,6 +263,15 @@ public boolean isOnlyMandateAllowed() { return false; } + /** + * Shall we show the stork login in the bku selection frontend? + * + * @return true, if is we should show stork login + */ + public boolean isShowStorkLogin() { + return oa_auth.getOASTORK().isStorkLogonEnabled(); + } + public Map getFormCustomizaten() { TemplatesType templates = oa_auth.getTemplates(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/FormBuildUtils.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/FormBuildUtils.java index e8af82872..9de1e8d88 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/FormBuildUtils.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/FormBuildUtils.java @@ -24,6 +24,9 @@ public class FormBuildUtils { private static String MANDATEVISIBLE = "#MANDATEVISIBLE#"; private static String MANDATECHECKED = "#MANDATECHECKED#"; + + private static String STORKVISIBLE = "#STORKVISIBLE#"; + private static final String TEMPLATEVISIBLE = " display: none"; private static final String TEMPLATEDISABLED = "disabled=\"true\""; private static final String TEMPLATECHECKED = "checked=\"true\""; @@ -52,7 +55,8 @@ public class FormBuildUtils { public static String customiceLayoutBKUSelection(String value, boolean isShowMandateCheckbox, - boolean isOnlyMandateAllowed, Map map) { + boolean isOnlyMandateAllowed, + Map map, boolean showStorkLogin) { if (isShowMandateCheckbox) value = value.replace(MANDATEVISIBLE, ""); @@ -67,6 +71,11 @@ public class FormBuildUtils { } else value = value.replace(MANDATECHECKED, TEMPLATE_ARIACHECKED + "\"false\""); + if (showStorkLogin) + value = value.replace(STORKVISIBLE, ""); + else + value = value.replace(STORKVISIBLE, TEMPLATEVISIBLE); + String fonttype = map.get(FONTFAMILY); if (MiscUtil.isNotEmpty(fonttype)) { String[] fonttypeList = fonttype.split(","); diff --git a/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html b/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html index f25e7129a..e28a67d75 100644 --- a/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html +++ b/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html @@ -807,7 +807,7 @@ -
+

Home Country Selection