diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2013-10-11 14:00:05 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2013-10-11 14:00:05 +0200 |
commit | 550ba6452a44cd93066fc5317de626d21758901b (patch) | |
tree | cfe49f04d9c8c2c06e8e4353e5bd676e6e963530 /id/ConfigWebTool | |
parent | 663ad546237fe9102c97e0eed2970e703d3034d9 (diff) | |
download | moa-id-spss-550ba6452a44cd93066fc5317de626d21758901b.tar.gz moa-id-spss-550ba6452a44cd93066fc5317de626d21758901b.tar.bz2 moa-id-spss-550ba6452a44cd93066fc5317de626d21758901b.zip |
-- Customizable BKUSelection Form and SendAssertion Form
-- OA specific Checkbox to disable SAML1
Diffstat (limited to 'id/ConfigWebTool')
11 files changed, 668 insertions, 145 deletions
diff --git a/id/ConfigWebTool/.classpath b/id/ConfigWebTool/.classpath index 0e6d0b69f..5bde2110d 100644 --- a/id/ConfigWebTool/.classpath +++ b/id/ConfigWebTool/.classpath @@ -26,7 +26,6 @@ <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> <attributes> <attribute name="maven.pomderived" value="true"/> - <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> </attributes> </classpathentry> <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/FormularCustomization.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/FormularCustomization.java new file mode 100644 index 000000000..0d13de3fe --- /dev/null +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/FormularCustomization.java @@ -0,0 +1,286 @@ +package at.gv.egovernment.moa.id.configuration.data; + +import java.util.Arrays; +import java.util.List; + +import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA; +import at.gv.egovernment.moa.id.commons.db.dao.config.BKUSelectionCustomizationType; +import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; +import at.gv.egovernment.moa.id.commons.db.dao.config.TemplatesType; +import at.gv.egovernment.moa.util.MiscUtil; + +public class FormularCustomization { + + private boolean showMandateLoginButton = true; + private boolean onlyMandateAllowed = false; + + private String fontType = null; + + private String frontColor = null; + private String backGroundColor = null; + private String header_FrontColor = null; + private String header_BackGroundColor = null; + private String header_text = null; + private String button_BackGroundColor = null; + private String button_BackGroundColorFocus = null; + private String button_FrontColor = null; + + private String appletRedirectTarget = null; + public static List<String> appletRedirectTargetList = null; + + public FormularCustomization() { + appletRedirectTargetList = Arrays.asList("","_blank","_self","_parent","_top"); + } + + + public void parse(OnlineApplication dbOAConfig) { + AuthComponentOA auth = dbOAConfig.getAuthComponentOA(); + + if (auth != null) { + TemplatesType templates = auth.getTemplates(); + if (templates != null) { + BKUSelectionCustomizationType formcustom = templates.getBKUSelectionCustomization(); + if (formcustom != null) { + + if (formcustom.isMandateLoginButton() != null) + showMandateLoginButton = formcustom.isMandateLoginButton(); + + if (formcustom.isOnlyMandateLoginAllowed() != null) + onlyMandateAllowed = formcustom.isOnlyMandateLoginAllowed(); + + if (MiscUtil.isNotEmpty(formcustom.getAppletRedirectTarget())) + appletRedirectTarget = formcustom.getAppletRedirectTarget(); + + if (MiscUtil.isNotEmpty(formcustom.getBackGroundColor())) + backGroundColor = formcustom.getBackGroundColor(); + + if (MiscUtil.isNotEmpty(formcustom.getButtonBackGroundColor())) + button_BackGroundColor = formcustom.getButtonBackGroundColor(); + + if (MiscUtil.isNotEmpty(formcustom.getButtonBackGroundColorFocus())) + button_BackGroundColorFocus = formcustom.getButtonBackGroundColorFocus(); + + if (MiscUtil.isNotEmpty(formcustom.getButtonFontColor())) + button_FrontColor = formcustom.getButtonFontColor(); + + if (MiscUtil.isNotEmpty(formcustom.getFontType())) + fontType = formcustom.getFontType(); + + if (MiscUtil.isNotEmpty(formcustom.getFrontColor())) + frontColor = formcustom.getFrontColor(); + + if (MiscUtil.isNotEmpty(formcustom.getHeaderBackGroundColor())) + header_BackGroundColor = formcustom.getHeaderBackGroundColor(); + + if (MiscUtil.isNotEmpty(formcustom.getHeaderFrontColor())) + header_FrontColor = formcustom.getHeaderFrontColor(); + + if (MiscUtil.isNotEmpty(formcustom.getHeaderText())) + header_text = formcustom.getHeaderText(); + } + } + } + } + + + /** + * @return the showMandateLoginButton + */ + public boolean isShowMandateLoginButton() { + return showMandateLoginButton; + } + + + /** + * @param showMandateLoginButton the showMandateLoginButton to set + */ + public void setShowMandateLoginButton(boolean showMandateLoginButton) { + this.showMandateLoginButton = showMandateLoginButton; + } + + + /** + * @return the onlyMandateAllowed + */ + public boolean isOnlyMandateAllowed() { + return onlyMandateAllowed; + } + + + /** + * @param onlyMandateAllowed the onlyMandateAllowed to set + */ + public void setOnlyMandateAllowed(boolean onlyMandateAllowed) { + this.onlyMandateAllowed = onlyMandateAllowed; + } + + + /** + * @return the fontType + */ + public String getFontType() { + return fontType; + } + + + /** + * @param fontType the fontType to set + */ + public void setFontType(String fontType) { + this.fontType = fontType; + } + + + /** + * @return the frontColor + */ + public String getFrontColor() { + return frontColor; + } + + + /** + * @param frontColor the frontColor to set + */ + public void setFrontColor(String frontColor) { + this.frontColor = frontColor; + } + + + /** + * @return the backGroundColor + */ + public String getBackGroundColor() { + return backGroundColor; + } + + + /** + * @param backGroundColor the backGroundColor to set + */ + public void setBackGroundColor(String backGroundColor) { + this.backGroundColor = backGroundColor; + } + + + /** + * @return the header_FrontColor + */ + public String getHeader_FrontColor() { + return header_FrontColor; + } + + + /** + * @param header_FrontColor the header_FrontColor to set + */ + public void setHeader_FrontColor(String header_FrontColor) { + this.header_FrontColor = header_FrontColor; + } + + + /** + * @return the header_BackGroundColor + */ + public String getHeader_BackGroundColor() { + return header_BackGroundColor; + } + + + /** + * @param header_BackGroundColor the header_BackGroundColor to set + */ + public void setHeader_BackGroundColor(String header_BackGroundColor) { + this.header_BackGroundColor = header_BackGroundColor; + } + + + /** + * @return the header_text + */ + public String getHeader_text() { + return header_text; + } + + + /** + * @param header_text the header_text to set + */ + public void setHeader_text(String header_text) { + this.header_text = header_text; + } + + + /** + * @return the button_BackGroundColor + */ + public String getButton_BackGroundColor() { + return button_BackGroundColor; + } + + + /** + * @param button_BackGroundColor the button_BackGroundColor to set + */ + public void setButton_BackGroundColor(String button_BackGroundColor) { + this.button_BackGroundColor = button_BackGroundColor; + } + + + /** + * @return the button_BackGroundColorFocus + */ + public String getButton_BackGroundColorFocus() { + return button_BackGroundColorFocus; + } + + + /** + * @param button_BackGroundColorFocus the button_BackGroundColorFocus to set + */ + public void setButton_BackGroundColorFocus(String button_BackGroundColorFocus) { + this.button_BackGroundColorFocus = button_BackGroundColorFocus; + } + + + /** + * @return the button_FrontColor + */ + public String getButton_FrontColor() { + return button_FrontColor; + } + + + /** + * @param button_FrontColor the button_FrontColor to set + */ + public void setButton_FrontColor(String button_FrontColor) { + this.button_FrontColor = button_FrontColor; + } + + + /** + * @return the appletRedirectTarget + */ + public String getAppletRedirectTarget() { + return appletRedirectTarget; + } + + /** + * @param appletRedirectTarget the appletRedirectTarget to set + */ + public void setAppletRedirectTarget(String appletRedirectTarget) { + this.appletRedirectTarget = appletRedirectTarget; + } + + + /** + * @return the appletredirecttargetlist + */ + public List<String> getAppletRedirectTargetList() { + return appletRedirectTargetList; + } + + + +} diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java index 90c02e0e4..07c07a964 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java @@ -8,7 +8,6 @@ import java.util.Map; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA; -import at.gv.egovernment.moa.id.commons.db.dao.config.BKUSelectionCustomizationType; import at.gv.egovernment.moa.id.commons.db.dao.config.BKUURLS; import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; import at.gv.egovernment.moa.id.commons.db.dao.config.IdentificationNumber; @@ -63,10 +62,6 @@ public class OAGeneralConfig { private boolean isHideBPKAuthBlock = false; - private boolean showMandateLoginButton = true; - private boolean onlyMandateAllowed = false; - private String bkuSelectionBackGroundColor = null; - private Map<String, byte[]> transformations; @@ -197,19 +192,6 @@ public class OAGeneralConfig { SLTemplates.add(el.getURL()); } } - - BKUSelectionCustomizationType bkuselectioncustom = templates.getBKUSelectionCustomization(); - if (bkuselectioncustom != null) { - - if (MiscUtil.isNotEmpty(bkuselectioncustom.getBackGroundColor())) - bkuSelectionBackGroundColor = bkuselectioncustom.getBackGroundColor(); - - if (bkuselectioncustom.isMandateLoginButton() != null) - showMandateLoginButton = bkuselectioncustom.isMandateLoginButton(); - - if (bkuselectioncustom.isOnlyMandateLoginAllowed() != null) - onlyMandateAllowed = bkuselectioncustom.isOnlyMandateLoginAllowed(); - } } if (SLTemplates != null && SLTemplates.size() > 0) @@ -571,55 +553,5 @@ public class OAGeneralConfig { */ public void setHideBPKAuthBlock(boolean isHideBPKAuthBlock) { this.isHideBPKAuthBlock = isHideBPKAuthBlock; - } - - - /** - * @return the showMandateLoginButton - */ - public boolean isShowMandateLoginButton() { - return showMandateLoginButton; - } - - - /** - * @param showMandateLoginButton the showMandateLoginButton to set - */ - public void setShowMandateLoginButton(boolean showMandateLoginButton) { - this.showMandateLoginButton = showMandateLoginButton; - } - - - /** - * @return the onlyMandateAllowed - */ - public boolean isOnlyMandateAllowed() { - return onlyMandateAllowed; - } - - - /** - * @param onlyMandateAllowed the onlyMandateAllowed to set - */ - public void setOnlyMandateAllowed(boolean onlyMandateAllowed) { - this.onlyMandateAllowed = onlyMandateAllowed; - } - - - /** - * @return the bkuSelectionBackGroundColor - */ - public String getBkuSelectionBackGroundColor() { - return bkuSelectionBackGroundColor; - } - - - /** - * @param bkuSelectionBackGroundColor the bkuSelectionBackGroundColor to set - */ - public void setBkuSelectionBackGroundColor(String bkuSelectionBackGroundColor) { - this.bkuSelectionBackGroundColor = bkuSelectionBackGroundColor; - } - - + } } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java index 687a06b9e..951052877 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java @@ -6,6 +6,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; public class OASAML1Config { + private boolean isActive = false; private boolean provideStammZahl = false; private boolean provideAuthBlock = false; private boolean provideIdentityLink = false; @@ -30,6 +31,8 @@ public class OASAML1Config { provideStammZahl = saml1.isProvideStammzahl(); useCondition = saml1.isUseCondition(); conditionLength = saml1.getConditionLength().intValue(); + if (saml1.isIsActive() != null) + isActive = saml1.isIsActive(); } } } @@ -76,6 +79,21 @@ public class OASAML1Config { public void setConditionLength(int conditionLength) { this.conditionLength = conditionLength; } + + /** + * @return the isActive + */ + public boolean isActive() { + return isActive; + } + + /** + * @param isActive the isActive to set + */ + public void setActive(boolean isActive) { + this.isActive = isActive; + } + } 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 4a05f9dbd..3ee870d11 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 @@ -38,6 +38,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; import at.gv.egovernment.moa.id.configuration.Constants; import at.gv.egovernment.moa.id.configuration.auth.AuthenticatedUser; +import at.gv.egovernment.moa.id.configuration.data.FormularCustomization; import at.gv.egovernment.moa.id.configuration.data.oa.OAGeneralConfig; import at.gv.egovernment.moa.id.configuration.data.oa.OAPVP2Config; import at.gv.egovernment.moa.id.configuration.data.oa.OASAML1Config; @@ -46,6 +47,7 @@ import at.gv.egovernment.moa.id.configuration.data.oa.OASTORKConfig; import at.gv.egovernment.moa.id.configuration.exception.ConfigurationException; import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper; import at.gv.egovernment.moa.id.configuration.helper.MailHelper; +import at.gv.egovernment.moa.id.configuration.validation.FormularCustomizationValitator; import at.gv.egovernment.moa.id.configuration.validation.TargetValidator; import at.gv.egovernment.moa.id.configuration.validation.ValidationHelper; import at.gv.egovernment.moa.id.configuration.validation.oa.OAGeneralConfigValidation; @@ -86,6 +88,7 @@ ServletResponseAware { private OASAML1Config saml1OA = new OASAML1Config(); private OASSOConfig ssoOA = new OASSOConfig(); private OASTORKConfig storkOA; + private FormularCustomization formOA = new FormularCustomization(); //STRUTS actions public String inital() { @@ -141,6 +144,7 @@ ServletResponseAware { generalOA.parse(onlineapplication); ssoOA.parse(onlineapplication); saml1OA.parse(onlineapplication); + formOA.parse(onlineapplication); List<String> errors = pvp2OA.parse(onlineapplication); @@ -314,16 +318,18 @@ ServletResponseAware { OASAML1ConfigValidation validatior_saml1 = new OASAML1ConfigValidation(); OASSOConfigValidation validatior_sso = new OASSOConfigValidation(); OASTORKConfigValidation validator_stork = new OASTORKConfigValidation(); + FormularCustomizationValitator validator_form = new FormularCustomizationValitator(); errors.addAll(validatior_general.validate(generalOA, authUser.isAdmin())); errors.addAll(validatior_pvp2.validate(pvp2OA)); errors.addAll(validatior_saml1.validate(saml1OA, generalOA)); errors.addAll(validatior_sso.validate(ssoOA, authUser.isAdmin())); errors.addAll(validator_stork.validate(storkOA)); + errors.addAll(validator_form.validate(formOA)); //Do not allow SSO in combination with special BKUSelection features if (ssoOA.isUseSSO() && - ( generalOA.isOnlyMandateAllowed() || !generalOA.isShowMandateLoginButton()) ) { + ( formOA.isOnlyMandateAllowed() || !formOA.isShowMandateLoginButton()) ) { log.warn("Special BKUSelection features can not be used in combination with SSO"); errors.add(LanguageHelper.getErrorString("validation.general.bkuselection.specialfeatures.valid")); } @@ -757,22 +763,25 @@ ServletResponseAware { bkuselectioncustom = new BKUSelectionCustomizationType(); templates.setBKUSelectionCustomization(bkuselectioncustom); } - - if (MiscUtil.isNotEmpty(generalOA.getBkuSelectionBackGroundColor())) { - String value; - if (!generalOA.getBkuSelectionBackGroundColor().startsWith("#")) - value = "#" + generalOA.getBkuSelectionBackGroundColor(); - else - value = generalOA.getBkuSelectionBackGroundColor(); - - bkuselectioncustom.setBackGroundColor(value); - - } else { - bkuselectioncustom.setBackGroundColor(""); - } - - bkuselectioncustom.setMandateLoginButton(generalOA.isShowMandateLoginButton()); - bkuselectioncustom.setOnlyMandateLoginAllowed(generalOA.isOnlyMandateAllowed()); + + bkuselectioncustom.setBackGroundColor(parseColor(formOA.getBackGroundColor())); + bkuselectioncustom.setFrontColor(parseColor(formOA.getFrontColor())); + + bkuselectioncustom.setHeaderBackGroundColor(parseColor(formOA.getHeader_BackGroundColor())); + bkuselectioncustom.setHeaderFrontColor(parseColor(formOA.getHeader_FrontColor())); + bkuselectioncustom.setHeaderText(formOA.getHeader_text()); + + bkuselectioncustom.setButtonBackGroundColor(parseColor(formOA.getButton_BackGroundColor())); + bkuselectioncustom.setButtonBackGroundColorFocus(parseColor(formOA.getButton_BackGroundColorFocus())); + bkuselectioncustom.setButtonFontColor(parseColor(formOA.getButton_FrontColor())); + + if (MiscUtil.isNotEmpty(formOA.getAppletRedirectTarget())) + bkuselectioncustom.setAppletRedirectTarget(formOA.getAppletRedirectTarget()); + + bkuselectioncustom.setFontType(formOA.getFontType()); + + bkuselectioncustom.setMandateLoginButton(formOA.isShowMandateLoginButton()); + bkuselectioncustom.setOnlyMandateLoginAllowed(formOA.isOnlyMandateAllowed()); } @@ -802,21 +811,28 @@ ServletResponseAware { log.info("Uploaded Certificate can not be parsed", e); return LanguageHelper.getErrorString("validation.pvp2.certificate.format"); } - + OASAML1 saml1 = authoa.getOASAML1(); if (saml1 == null) { saml1 = new OASAML1(); authoa.setOASAML1(saml1); } - saml1.setProvideAUTHBlock(saml1OA.isProvideAuthBlock()); - saml1.setProvideCertificate(saml1OA.isProvideCertificate()); - saml1.setProvideFullMandatorData(saml1OA.isProvideFullMandateData()); - saml1.setProvideIdentityLink(saml1OA.isProvideIdentityLink()); - saml1.setProvideStammzahl(saml1OA.isProvideStammZahl()); - saml1.setUseCondition(saml1OA.isUseCondition()); - saml1.setConditionLength(BigInteger.valueOf(saml1OA.getConditionLength())); - //TODO: set sourceID - //saml1.setSourceID(""); + + if (authUser.isAdmin()) { + saml1.setIsActive(saml1OA.isActive()); + } + + if (saml1.isIsActive()) { + saml1.setProvideAUTHBlock(saml1OA.isProvideAuthBlock()); + saml1.setProvideCertificate(saml1OA.isProvideCertificate()); + saml1.setProvideFullMandatorData(saml1OA.isProvideFullMandateData()); + saml1.setProvideIdentityLink(saml1OA.isProvideIdentityLink()); + saml1.setProvideStammzahl(saml1OA.isProvideStammZahl()); + saml1.setUseCondition(saml1OA.isUseCondition()); + saml1.setConditionLength(BigInteger.valueOf(saml1OA.getConditionLength())); + //TODO: set sourceID + //saml1.setSourceID(""); + } OASSO sso = authoa.getOASSO(); if (sso == null) { @@ -865,6 +881,18 @@ ServletResponseAware { return null; } + private String parseColor(String color) { + String value = ""; + + if (MiscUtil.isNotEmpty(color)) { + if (!color.startsWith("#")) + value = "#" + color; + else + value = color; + } + return value; + } + private void generateUserSpecificConfigurationOptions(UserDatabase userdb) { if (userdb.isIsMandateUser() != null && userdb.isIsMandateUser()) { @@ -1076,4 +1104,20 @@ ServletResponseAware { public void setDeaktivededBusinessService(boolean deaktivededBusinessService) { this.deaktivededBusinessService = deaktivededBusinessService; } + + /** + * @return the formOA + */ + public FormularCustomization getFormOA() { + return formOA; + } + + /** + * @param formOA the formOA to set + */ + public void setFormOA(FormularCustomization formOA) { + this.formOA = formOA; + } + + } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/FormularCustomizationValitator.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/FormularCustomizationValitator.java new file mode 100644 index 000000000..039b6eac3 --- /dev/null +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/FormularCustomizationValitator.java @@ -0,0 +1,132 @@ +package at.gv.egovernment.moa.id.configuration.validation; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.log4j.Logger; + +import at.gv.egovernment.moa.id.configuration.data.FormularCustomization; +import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper; +import at.gv.egovernment.moa.util.MiscUtil; + +public class FormularCustomizationValitator { + + private static final Logger log = Logger.getLogger(FormularCustomizationValitator.class); + + public List<String> validate(FormularCustomization form) { + + List<String> errors = new ArrayList<String>(); + String check; + + if (form.isOnlyMandateAllowed() && !form.isShowMandateLoginButton()) { + log.warn("OnlyMandateAllowed in combination with hidden MandateLoginCheckbox is not possible."); + errors.add(LanguageHelper.getErrorString("validation.general.bkuselection.specialfeatures.combination")); + } + + check = form.getBackGroundColor(); + if (MiscUtil.isNotEmpty(check)) { + if (!check.startsWith("#")) + check = "#" + check; + + if (!ValidationHelper.isValidHexValue(check)) { + log.warn("BKUSelectionBackGroundColor is not a valid hex value " + check); + errors.add(LanguageHelper.getErrorString("validation.general.form.color.background")); + } + } + + check = form.getFrontColor(); + if (MiscUtil.isNotEmpty(check)) { + if (!check.startsWith("#")) + check = "#" + check; + + if (!ValidationHelper.isValidHexValue(check)) { + log.warn("BKUSelectionFrontColor is not a valid hex value " + check); + errors.add(LanguageHelper.getErrorString("validation.general.form.color.front")); + } + } + + check = form.getHeader_BackGroundColor(); + if (MiscUtil.isNotEmpty(check)) { + if (!check.startsWith("#")) + check = "#" + check; + + if (!ValidationHelper.isValidHexValue(check)) { + log.warn("HeaderBackGroundColor is not a valid hex value " + check); + errors.add(LanguageHelper.getErrorString("validation.general.form.header.color.back")); + } + } + + check = form.getHeader_FrontColor(); + if (MiscUtil.isNotEmpty(check)) { + if (!check.startsWith("#")) + check = "#" + check; + + if (!ValidationHelper.isValidHexValue(check)) { + log.warn("HeaderFrontColor is not a valid hex value " + check); + errors.add(LanguageHelper.getErrorString("validation.general.form.header.color.front")); + } + } + + check = form.getHeader_text(); + if (MiscUtil.isNotEmpty(check)) { + if (ValidationHelper.containsPotentialCSSCharacter(check, false)) { + log.warn("HeaderText contains potentail XSS characters: " + check); + errors.add(LanguageHelper.getErrorString("validation.general.form.header.text", + new Object[] {ValidationHelper.getPotentialCSSCharacter(false)} )); + } + } + + check = form.getButton_BackGroundColor(); + if (MiscUtil.isNotEmpty(check)) { + if (!check.startsWith("#")) + check = "#" + check; + + if (!ValidationHelper.isValidHexValue(check)) { + log.warn("ButtonBackGroundColor is not a valid hex value " + check); + errors.add(LanguageHelper.getErrorString("validation.general.form.button.color.back")); + } + } + + check = form.getButton_BackGroundColorFocus(); + if (MiscUtil.isNotEmpty(check)) { + if (!check.startsWith("#")) + check = "#" + check; + + if (!ValidationHelper.isValidHexValue(check)) { + log.warn("ButtonBackGroundColorFocus is not a valid hex value " + check); + errors.add(LanguageHelper.getErrorString("validation.general.form.button.color.back.focus")); + } + } + + check = form.getButton_FrontColor(); + if (MiscUtil.isNotEmpty(check)) { + if (!check.startsWith("#")) + check = "#" + check; + + if (!ValidationHelper.isValidHexValue(check)) { + log.warn("ButtonFrontColor is not a valid hex value " + check); + errors.add(LanguageHelper.getErrorString("validation.general.form.button.color.front")); + } + } + + check = form.getAppletRedirectTarget(); + if (MiscUtil.isNotEmpty(check)) { + if (!FormularCustomization.appletRedirectTargetList.contains(check)) { + log.warn("AppletRedirectTarget has not valid value " + check); + errors.add(LanguageHelper.getErrorString("validation.general.form.appletredirecttarget")); + } + } + + check = form.getFontType(); + if (MiscUtil.isNotEmpty(check)) { + if (ValidationHelper.containsPotentialCSSCharacter(check, true)) { + log.warn("FontType contains potentail XSS characters: " + check); + errors.add(LanguageHelper.getErrorString("validation.general.form.fonttype", + new Object[] {ValidationHelper.getPotentialCSSCharacter(true)} )); + } + } + + return errors; + + } +} diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAGeneralConfigValidation.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAGeneralConfigValidation.java index 9903b5391..87ac31e89 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAGeneralConfigValidation.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAGeneralConfigValidation.java @@ -32,23 +32,6 @@ public class OAGeneralConfigValidation { new Object[] {ValidationHelper.getPotentialCSSCharacter(false)} )); } } - - check = form.getBkuSelectionBackGroundColor(); - if (MiscUtil.isNotEmpty(check)) { - if (!check.startsWith("#")) - check = "#" + check; - - if (!ValidationHelper.isValidHexValue(check)) { - log.warn("BKUSelectionBackGroundColor is not a valid hex value " + check); - errors.add(LanguageHelper.getErrorString("validation.general.bkuselectioncolor.valid")); - } - - } - - if (form.isOnlyMandateAllowed() && !form.isShowMandateLoginButton()) { - log.warn("OnlyMandateAllowed in combination with hidden MandateLoginCheckbox is not possible."); - errors.add(LanguageHelper.getErrorString("validation.general.bkuselection.specialfeatures.combination")); - } } //Check BKU URLs diff --git a/id/ConfigWebTool/src/main/resources/applicationResources.properties b/id/ConfigWebTool/src/main/resources/applicationResources.properties index 5e337c7a5..103be82c4 100644 --- a/id/ConfigWebTool/src/main/resources/applicationResources.properties +++ b/id/ConfigWebTool/src/main/resources/applicationResources.properties @@ -182,9 +182,6 @@ webpages.oaconfig.general.aditional.iframe=B\u00FCrgerkartenauswahl im IFrame webpages.oaconfig.general.aditional.useUTC=UTC Zeit verwenden webpages.oaconfig.general.aditional.calculateHPI="TODO!" webpages.oaconfig.general.isHideBPKAuthBlock=bPK/wbPK im AuthBlock ausblenden -webpages.oaconfig.general.BKUSelection.isMandateLoginCheckboxVisible=Vollmachtenanmeldung anzeigen -webpages.oaconfig.general.BKUSelection.isOnlyMandateLoginAllowed=Nur Vollmachtenanmeldung erlauben -webpages.oaconfig.general.BKUSelection.backgroundcolor=Hintergrundfarbe der BKU-Auswahl webpages.oaconfig.menu.saml1.show=SAML1 Konfiguration einblenden webpages.oaconfig.menu.saml1.hidden=SAML1 Konfiguration ausblenden @@ -195,12 +192,29 @@ webpages.oaconfig.menu.stork=STORK Konfiguration webpages.oaconfig.protocols.header=Authentifizierungsprotokolle +webpages.oaconfig.general.BKUSelection.button.show=Formularkonfiguration einblenden +webpages.oaconfig.general.BKUSelection.button.hidden=Formularkonfiguration ausblenden +webpages.oaconfig.general.BKUSelection.header=Formularkonfiguration +webpages.oaconfig.general.BKUSelection.isMandateLoginCheckboxVisible=Vollmachtenanmeldung anzeigen +webpages.oaconfig.general.BKUSelection.isOnlyMandateLoginAllowed=Nur Vollmachtenanmeldung erlauben +webpages.oaconfig.general.BKUSelection.backgroundcolor=Hintergrundfarbe der BKU-Auswahl +webpages.oaconfig.general.BKUSelection.frontcolor=Vordergrundfarbe der BKU-Auswahl +webpages.oaconfig.general.BKUSelection.header.backgroundcolor=Hintergrundfarbe der \u00DCberschrift +webpages.oaconfig.general.BKUSelection.header.frontcolor=Vordergrundfarbe der \u00DCberschrift +webpages.oaconfig.general.BKUSelection.header.text=\u00DCberschriftstext +webpages.oaconfig.general.BKUSelection.header.button.background=Hintergrundfarbe der Schaltfl\u00E4chen +webpages.oaconfig.general.BKUSelection.header.button.background.focus=Hintergrundfarbe der Schaltfl\u00E4chen (Focus) +webpages.oaconfig.general.BKUSelection.header.button.front=Vordergrundfarbe der Schaltfl\u00E4chen +webpages.oaconfig.general.BKUSelection.redirectTarget=Targetparameter +webpages.oaconfig.general.BKUSelection.fonttype=Formularschrifttyp + webpages.oaconfig.sso.header=Single Sign-On webpages.oaconfig.sso.singlelogouturl=Single Log-Out URL webpages.oaconfig.sso.useauthdataframe=Zus\u00E4tzliche Userabfrage webpages.oaconfig.sso.usesso=Single Sign-On verwenden webpages.oaconfig.protocols.saml1.header=SAML1 Konfiguration +webpages.oaconfig.saml1.isActice=SAML1 aktivieren webpages.oaconfig.saml1.provideStammZahl=Stammzahl \u00FCbertragen webpages.oaconfig.saml1.provideAuthBlock=Authentifizierungsblock \u00FCbertragen webpages.oaconfig.saml1.provideIdentityLink=Personenbindung \u00FCbertragen @@ -303,9 +317,6 @@ validation.general.slrequest.filename.valid=Der Dateiname der angegebenen Securt validation.general.slrequest.file.valid=Die angegebenen SecurtityLayer Transformation konnte nicht geladen werden. validation.general.aditionalauthblocktext=Der Zusatztext f\u00FCr den AuthBlock enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0} -validation.general.bkuselectioncolor.valid=Die Hintergrundfarbe f\u00FCr die BKU Auswahl enth\u00E4lt keinen g\u00FCltigen Hexadezimalwert. (z.B. \#FFFFFF) -validation.general.bkuselection.specialfeatures.valid=Die speziellen Einstellungen f\u00FCr die BKU Auswahl (Vollmachtsanmeldung ausblenden / zwingend voraussetzen) k\u00F6nnen nicht in Kombination mit SSO verwendet werden. -validation.general.bkuselection.specialfeatures.combination=Eine zwingend erforderliche Vollmachtenanmeldung in Kombination mit einer ausgeblendeten Vollmachtenauswahlcheckbox ist nicht m\u00F6glich. validation.general.bku.handy.empty=Die URL f\u00FCr die Handy-BKU ist leer. validation.general.bku.handy.valid=Die URL f\u00FCr die Handy-BKU hat kein g\u00FCltiges Format. validation.general.bku.local.empty=Die URL f\u00FCr die lokale BKU ist leer. @@ -349,3 +360,15 @@ validation.sso.logouturl.valid=Die URL zum Single Log-Out Service wei\u00DFt kei validation.saml1.providestammzahl=ProvideStammZahl kann nicht mit Applikationen aus dem privatwirtschaftlichen Bereich kombiniert werden. +validation.general.bkuselection.specialfeatures.valid=Die speziellen Einstellungen f\u00FCr die BKU Auswahl (Vollmachtsanmeldung ausblenden / zwingend voraussetzen) k\u00F6nnen nicht in Kombination mit SSO verwendet werden. +validation.general.bkuselection.specialfeatures.combination=Eine zwingend erforderliche Vollmachtenanmeldung in Kombination mit einer ausgeblendeten Vollmachtenauswahlcheckbox ist nicht m\u00F6glich. +validation.general.form.color.background=Die Hintergrundfarbe f\\u00FCr die BKU Auswahl enth\\u00E4lt keinen g\\u00FCltigen Hexadezimalwert. (z.B. \\#FFFFFF) +validation.general.form.color.front=Die Vordergrundfarbe f\\u00FCr die BKU Auswahl enth\\u00E4lt keinen g\\u00FCltigen Hexadezimalwert. (z.B. \\#FFFFFF) +validation.general.form.header.color.back=Die Hintergrundfarbe der BKU-Auswahl\\u00FCberschrift enth\\u00E4lt keinen g\\u00FCltigen Hexadezimalwert. (z.B. \\#FFFFFF) +validation.general.form.header.color.front=Die Vordergrundfarbe der BKU-Auswahl\\u00FCberschrift enth\\u00E4lt keinen g\\u00FCltigen Hexadezimalwert. (z.B. \\#FFFFFF) +validation.general.form.header.text=Die BKU-Auswahl\\u00FCberschrift enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0} +validation.general.form.button.color.back.focus=Die Hintergrundfarbe f\\u00FCr Focus der BKU-Auswahlbuttons enth\\u00E4lt keinen g\\u00FCltigen Hexadezimalwert. (z.B. \\#FFFFFF) +validation.general.form.button.color.back=Die Hintergrundfarbe der BKU-Auswahlbuttons enth\\u00E4lt keinen g\\u00FCltigen Hexadezimalwert. (z.B. \\#FFFFFF) +validation.general.form.button.color.front=Die Vordergrundfarbe der BKU-Auswahlbuttons enth\\u00E4lt keinen g\\u00FCltigen Hexadezimalwert. (z.B. \\#FFFFFF) +validation.general.form.appletredirecttarget=Der RedirectTarget beinhaltet einen ung\\u00FCltiten Wert. +validation.general.form.fonttype=Der BKU-Auswahl Schrifttyp enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
\ No newline at end of file diff --git a/id/ConfigWebTool/src/main/webapp/css/index.css b/id/ConfigWebTool/src/main/webapp/css/index.css index 6733efd4d..911db5334 100644 --- a/id/ConfigWebTool/src/main/webapp/css/index.css +++ b/id/ConfigWebTool/src/main/webapp/css/index.css @@ -134,6 +134,19 @@ display: none; } +#formcustom_button_hidden { + display: none; +} + +#formcustom_button_show { + margin-bottom: 50px; + clear: both; +} + +#formcustom_area { + margin-bottom: 50px; +} + #mail_area input { float: right; } diff --git a/id/ConfigWebTool/src/main/webapp/js/common.js b/id/ConfigWebTool/src/main/webapp/js/common.js index ce2e51863..d32350ce1 100644 --- a/id/ConfigWebTool/src/main/webapp/js/common.js +++ b/id/ConfigWebTool/src/main/webapp/js/common.js @@ -44,6 +44,17 @@ function oaPVP2(){ $('#button_pvp2_hidden').css('display', "block"); } } +function oaFormCustom() { + if ($('#formcustom_area').css('display') == "block") { + $('#formcustom_area').css('display', "none"); + $('#formcustom_button_show').css('display', "block"); + $('#formcustom_button_hidden').css('display', "none"); + } else { + $('#formcustom_area').css('display', "block"); + $('#formcustom_button_show').css('display', "none"); + $('#formcustom_button_hidden').css('display', "block"); + } +} function editOA(oaid){ $('#selectOAForm_OAID').val(oaid); $('#selectOAForm').submit(); diff --git a/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp b/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp index 6bca21435..f7a722893 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp @@ -286,12 +286,15 @@ <div class="oa_config_block"> <h3><%=LanguageHelper.getGUIString("webpages.oaconfig.protocols.header", request) %></h3> - <button type="button" class="oa_buttons" onclick="oaSAML1();" id="button_smal1_show"> - <%=LanguageHelper.getGUIString("webpages.oaconfig.menu.saml1.show", request) %> - </button> - <button type="button" class="oa_buttons" onclick="oaSAML1();" id="button_saml1_hidden"> - <%=LanguageHelper.getGUIString("webpages.oaconfig.menu.saml1.hidden", request) %> - </button> + + <s:if test="authUser.isAdmin() || saml1OA.isActive()"> + <button type="button" class="oa_buttons" onclick="oaSAML1();" id="button_smal1_show"> + <%=LanguageHelper.getGUIString("webpages.oaconfig.menu.saml1.show", request) %> + </button> + <button type="button" class="oa_buttons" onclick="oaSAML1();" id="button_saml1_hidden"> + <%=LanguageHelper.getGUIString("webpages.oaconfig.menu.saml1.hidden", request) %> + </button> + </s:if> <button type="button" class="oa_buttons" onclick="oaPVP2();" id="button_pvp2_show"> <%=LanguageHelper.getGUIString("webpages.oaconfig.menu.pvp2.show", request) %> @@ -302,6 +305,15 @@ <div id="oa_saml1_area" class="oa_protocol_area"> <h4><%=LanguageHelper.getGUIString("webpages.oaconfig.protocols.saml1.header", request) %></h4> + + <s:if test="authUser.isAdmin()"> + <s:checkbox name="saml1OA.Active" + value="%{saml1OA.Active}" + labelposition="left" + key="webpages.oaconfig.saml1.isActice" + cssClass="checkbox"> + </s:checkbox> + </s:if> <s:checkbox name="saml1OA.provideStammZahl" value="%{saml1OA.provideStammZahl}" labelposition="left" @@ -395,26 +407,96 @@ cssClass="textfield_large"> </s:textarea> - <s:textfield name="generalOA.bkuSelectionBackGroundColor" - value="%{generalOA.bkuSelectionBackGroundColor}" - labelposition="left" - key="webpages.oaconfig.general.BKUSelection.backgroundcolor" - cssClass="textfield_middle"> - </s:textfield> - <s:checkbox name="generalOA.showMandateLoginButton" - value="%{generalOA.showMandateLoginButton}" - labelposition="left" - key="webpages.oaconfig.general.BKUSelection.isMandateLoginCheckboxVisible" - cssClass="checkbox"> - </s:checkbox> - - <s:checkbox name="generalOA.onlyMandateAllowed" - value="%{generalOA.onlyMandateAllowed}" - labelposition="left" - key="webpages.oaconfig.general.BKUSelection.isOnlyMandateLoginAllowed" - cssClass="checkbox"> - </s:checkbox> + <button type="button" class="oa_buttons" onclick="oaFormCustom();" id="formcustom_button_show"> + <%=LanguageHelper.getGUIString("webpages.oaconfig.general.BKUSelection.button.show", request) %> + </button> + <button type="button" class="oa_buttons" onclick="oaFormCustom();" id="formcustom_button_hidden"> + <%=LanguageHelper.getGUIString("webpages.oaconfig.general.BKUSelection.button.hidden", request) %> + </button> + + <div id="formcustom_area" class="oa_protocol_area"> + <h4><%=LanguageHelper.getGUIString("webpages.oaconfig.general.BKUSelection.header", request) %></h4> + + <s:checkbox name="formOA.showMandateLoginButton" + value="%{formOA.showMandateLoginButton}" + labelposition="left" + key="webpages.oaconfig.general.BKUSelection.isMandateLoginCheckboxVisible" + cssClass="checkbox"> + </s:checkbox> + <s:checkbox name="formOA.onlyMandateAllowed" + value="%{formOA.onlyMandateAllowed}" + labelposition="left" + key="webpages.oaconfig.general.BKUSelection.isOnlyMandateLoginAllowed" + cssClass="checkbox"> + </s:checkbox> + + <s:textfield name="formOA.backGroundColor" + value="%{formOA.backGroundColor}" + labelposition="left" + key="webpages.oaconfig.general.BKUSelection.backgroundcolor" + cssClass="textfield_middle"> + </s:textfield> + <s:textfield name="formOA.frontColor" + value="%{formOA.frontColor}" + labelposition="left" + key="webpages.oaconfig.general.BKUSelection.frontcolor" + cssClass="textfield_middle"> + </s:textfield> + + <s:textfield name="formOA.header_BackGroundColor" + value="%{formOA.header_BackGroundColor}" + labelposition="left" + key="webpages.oaconfig.general.BKUSelection.header.backgroundcolor" + cssClass="textfield_middle"> + </s:textfield> + <s:textfield name="formOA.header_FrontColor" + value="%{formOA.header_FrontColor}" + labelposition="left" + key="webpages.oaconfig.general.BKUSelection.header.frontcolor" + cssClass="textfield_middle"> + </s:textfield> + <s:textfield name="formOA.header_text" + value="%{formOA.header_text}" + labelposition="left" + key="webpages.oaconfig.general.BKUSelection.header.text" + cssClass="textfield_middle"> + </s:textfield> + + <s:textfield name="formOA.button_BackGroundColor" + value="%{formOA.button_BackGroundColor}" + labelposition="left" + key="webpages.oaconfig.general.BKUSelection.header.button.background" + cssClass="textfield_middle"> + </s:textfield> + <s:textfield name="formOA.button_BackGroundColorFocus" + value="%{formOA.button_BackGroundColorFocus}" + labelposition="left" + key="webpages.oaconfig.general.BKUSelection.header.button.background.focus" + cssClass="textfield_middle"> + </s:textfield> + <s:textfield name="formOA.button_FrontColor" + value="%{formOA.button_FrontColor}" + labelposition="left" + key="webpages.oaconfig.general.BKUSelection.header.button.front" + cssClass="textfield_middle"> + </s:textfield> + + <s:select list="formOA.appletRedirectTargetList" + key="webpages.oaconfig.general.BKUSelection.redirectTarget" + labelposition="left" + cssClass="selectfield" + value="%{formOA.appletRedirectTarget}" + name="formOA.appletRedirectTarget"> + </s:select> + <s:textfield name="formOA.fontType" + value="%{formOA.fontType}" + labelposition="left" + key="webpages.oaconfig.general.BKUSelection.fonttype" + cssClass="textfield_long"> + </s:textfield> + + </div> </s:if> </div> |