diff options
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at/gv')
-rw-r--r-- | id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java | 52 |
1 files changed, 38 insertions, 14 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java index 0f1673c3a..32ffd2ba3 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java @@ -308,14 +308,36 @@ public class EditGeneralConfigAction extends BasicAction { legprot = new LegacyAllowed(); dbprotocols.setLegacyAllowed(legprot); } - - List<String> el = new ArrayList<String>(); - if (moaconfig.isLegacy_pvp2()) - el.add(Constants.MOA_CONFIG_PROTOCOL_PVP2); - if (moaconfig.isLegacy_saml1()) - el.add(Constants.MOA_CONFIG_PROTOCOL_SAML1); - legprot.setProtocolName(el); + List<String> el = legprot.getProtocolName(); + if (el == null) { + el = new ArrayList<String>(); + legprot.setProtocolName(el); + + } + + //Workaround for DB cleaning is only needed for one or the releases (insert in 2.1.1) + if (el.size() > 2) + el.clear(); + + if (el.contains(Constants.MOA_CONFIG_PROTOCOL_PVP2)) { + if (!moaconfig.isLegacy_pvp2()) + el.remove(Constants.MOA_CONFIG_PROTOCOL_PVP2); + + } else { + if (moaconfig.isLegacy_pvp2()) + el.add(Constants.MOA_CONFIG_PROTOCOL_PVP2); + } + + if (el.contains(Constants.MOA_CONFIG_PROTOCOL_SAML1)) { + if (!moaconfig.isLegacy_saml1()) + el.remove(Constants.MOA_CONFIG_PROTOCOL_SAML1); + + } else { + if (moaconfig.isLegacy_saml1()) + el.add(Constants.MOA_CONFIG_PROTOCOL_SAML1); + } + SAML1 saml1= dbprotocols.getSAML1(); if (saml1 == null) { saml1 = new SAML1(); @@ -385,15 +407,17 @@ public class EditGeneralConfigAction extends BasicAction { cont.setGivenName(StringHelper.getUTF8String( moaconfig.getPvp2Contact().getGivenname())); - //TODO: change to list if required - if (MiscUtil.isNotEmpty(moaconfig.getPvp2Contact().getMail())) + if (cont.getMail() != null && cont.getMail().size() > 0) + cont.getMail().set(0, moaconfig.getPvp2Contact().getMail()); + else cont.setMail(Arrays.asList(moaconfig.getPvp2Contact().getMail())); - if (MiscUtil.isNotEmpty(moaconfig.getPvp2Contact().getPhone())) + + if (cont.getPhone() != null && cont.getPhone().size() > 0) + cont.getPhone().set(0, moaconfig.getPvp2Contact().getPhone()); + else cont.setPhone(Arrays.asList(moaconfig.getPvp2Contact().getPhone())); - - if (MiscUtil.isNotEmpty(moaconfig.getPvp2Contact().getSurname())) - cont.setSurName(StringHelper.getUTF8String( - moaconfig.getPvp2Contact().getSurname())); + + cont.setSurName(StringHelper.getUTF8String(moaconfig.getPvp2Contact().getSurname())); if (MiscUtil.isNotEmpty(moaconfig.getPvp2Contact().getType())) cont.setType(moaconfig.getPvp2Contact().getType()); |