diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2013-09-04 07:18:39 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2013-09-04 07:18:39 +0200 |
commit | 8854b5c2c1e342b891271a04face4f4479653d46 (patch) | |
tree | 5dd6054fad6827dc50eeaf95dd629467458d2a12 | |
parent | 7c6ecaa8adb365a6c670cb86bb68be94136dc6a0 (diff) | |
download | moa-id-spss-8854b5c2c1e342b891271a04face4f4479653d46.tar.gz moa-id-spss-8854b5c2c1e342b891271a04face4f4479653d46.tar.bz2 moa-id-spss-8854b5c2c1e342b891271a04face4f4479653d46.zip |
Configuration Tool Update and Bugfix
-- Username/Password login update
-- EditUser, insert second password textfield
-- OAConfig: insert OA specific SecurityLayer Templates
-- OAConfig: SecurityLayer Version only for admin
11 files changed, 252 insertions, 45 deletions
diff --git a/common/src/main/java/at/gv/egovernment/moa/util/URLEncoder.java b/common/src/main/java/at/gv/egovernment/moa/util/URLEncoder.java index 3255b3157..e6df1fd33 100644 --- a/common/src/main/java/at/gv/egovernment/moa/util/URLEncoder.java +++ b/common/src/main/java/at/gv/egovernment/moa/util/URLEncoder.java @@ -44,6 +44,8 @@ public class URLEncoder { * @throws UnsupportedEncodingException when the desired encoding is not supported */ public static String encode(String s, String encoding) throws UnsupportedEncodingException { +// if (MiscUtil.isEmpty(s)) +// return null; byte[] barr = s.getBytes(encoding); ByteArrayInputStream bin = new ByteArrayInputStream(barr); StringWriter out = new StringWriter(); diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/UserDatabaseFrom.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/UserDatabaseFrom.java index e62160285..881cdf277 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/UserDatabaseFrom.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/UserDatabaseFrom.java @@ -14,6 +14,7 @@ public class UserDatabaseFrom { private String phone; private String username; private String password; + private String password_second; private boolean active = false; private boolean admin = false; private boolean passwordActive; @@ -232,6 +233,21 @@ public class UserDatabaseFrom { public void setUserID(String userID) { this.userID = userID; } + + /** + * @return the password_second + */ + public String getPassword_second() { + return password_second; + } + + /** + * @param password_second the password_second to set + */ + public void setPassword_second(String password_second) { + this.password_second = password_second; + } + } 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 129d62346..57ae4863a 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 @@ -41,9 +41,7 @@ public class OAGeneralConfig { private String identificationType = null; private String aditionalAuthBlockText = null; - - //TODO: look Template!!! - + private String mandateProfiles = null; private boolean isActive = false; @@ -55,8 +53,9 @@ public class OAGeneralConfig { private String keyBoxIdentifier = null; private static Map<String, String> keyBoxIdentifierList; - private String templateURL = null; - + private boolean legacy = false; + List<String> SLTemplates = null; + private Map<String, byte[]> transformations; @@ -141,12 +140,21 @@ public class OAGeneralConfig { TemplatesType templates = oaauth.getTemplates(); if (templates != null) { aditionalAuthBlockText = templates.getAditionalAuthBlockText(); - TemplateType templatetype = templates.getTemplate(); + List<TemplateType> templatetype = templates.getTemplate(); if (templatetype != null) { - templateURL = templatetype.getURL(); + if (SLTemplates == null) { + SLTemplates = new ArrayList<String>(); + } + + for (TemplateType el : templatetype) { + SLTemplates.add(el.getURL()); + } } } + + if (SLTemplates != null && SLTemplates.size() > 0) + legacy = true; List<TransformsInfoType> transforminfos = oaauth.getTransformsInfo(); transformations = new HashMap<String, byte[]>(); @@ -306,20 +314,6 @@ public class OAGeneralConfig { } /** - * @return the templateURL - */ - public String getTemplateURL() { - return templateURL; - } - - /** - * @param templateURL the templateURL to set - */ - public void setTemplateURL(String templateURL) { - this.templateURL = templateURL; - } - - /** * @return the transformations */ public Map<String, byte[]> getTransformations() { @@ -388,6 +382,85 @@ public class OAGeneralConfig { keyBoxIdentifierList = list; } + + /** + * @return the legacy + */ + public boolean isLegacy() { + return legacy; + } + + + /** + * @param legacy the legacy to set + */ + public void setLegacy(boolean legacy) { + this.legacy = legacy; + } + + + /** + * @return the sLTemplateURL1 + */ + public String getSLTemplateURL1() { + if (SLTemplates != null && SLTemplates.size() > 0) + return SLTemplates.get(0); + else + return null; + } + + + /** + * @param sLTemplateURL1 the sLTemplateURL1 to set + */ + public void setSLTemplateURL1(String sLTemplateURL1) { + if (SLTemplates == null) + SLTemplates = new ArrayList<String>(); + SLTemplates.add(sLTemplateURL1); + } + + + /** + * @return the sLTemplateURL2 + */ + public String getSLTemplateURL2() { + if (SLTemplates != null && SLTemplates.size() > 1) + return SLTemplates.get(1); + else + return null; + } + + + /** + * @param sLTemplateURL2 the sLTemplateURL2 to set + */ + public void setSLTemplateURL2(String sLTemplateURL2) { + if (SLTemplates == null) + SLTemplates = new ArrayList<String>(); + SLTemplates.add(sLTemplateURL2); + } + + + /** + * @return the sLTemplateURL3 + */ + public String getSLTemplateURL3() { + if (SLTemplates != null && SLTemplates.size() > 2) + return SLTemplates.get(2); + else + return null; + } + + + /** + * @param sLTemplateURL3 the sLTemplateURL3 to set + */ + public void setSLTemplateURL3(String sLTemplateURL3) { + if (SLTemplates == null) + SLTemplates = new ArrayList<String>(); + SLTemplates.add(sLTemplateURL3); + } + } 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 0f2a40aa7..297d80726 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 @@ -370,12 +370,35 @@ ServletResponseAware { } templates.setAditionalAuthBlockText(generalOA.getAditionalAuthBlockText()); - TemplateType template = templates.getTemplate(); - if (template == null) { - //TODO: if OA specific templateURL is required + List<TemplateType> template = templates.getTemplate(); + if (generalOA.isLegacy()) { + if (template == null) + template = new ArrayList<TemplateType>(); + else + template.clear(); + + if (MiscUtil.isNotEmpty(generalOA.getSLTemplateURL1())) { + TemplateType el = new TemplateType(); + el.setURL(generalOA.getSLTemplateURL1()); + template.add(el); + } + if (MiscUtil.isNotEmpty(generalOA.getSLTemplateURL2())) { + TemplateType el = new TemplateType(); + el.setURL(generalOA.getSLTemplateURL2()); + template.add(el); + } + if (MiscUtil.isNotEmpty(generalOA.getSLTemplateURL3())) { + TemplateType el = new TemplateType(); + el.setURL(generalOA.getSLTemplateURL3()); + template.add(el); + } + + } else { + if (template != null && template.size() > 0) + template.clear(); } - + //set default transformation if it is empty List<TransformsInfoType> transformsInfo = authoa.getTransformsInfo(); if (transformsInfo == null) { 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 6aeebcf7b..6078caa87 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 @@ -72,22 +72,23 @@ public class IndexAction extends ActionSupport implements ServletRequestAware, } } + UserDatabase dbuser = ConfigurationDBRead.getUserWithUserName(username); if (dbuser == null) { log.warn("Unknown Username"); - addActionError(LanguageHelper.getErrorString("webpages.index.username.unkown")); + addActionError(LanguageHelper.getErrorString("webpages.index.login.notallowed")); return Constants.STRUTS_ERROR; } else { if (!dbuser.isIsActive()) { log.warn("Username " + dbuser.getUsername() + " is not active"); - addActionError(LanguageHelper.getErrorString("webpages.index.username.notactive")); + addActionError(LanguageHelper.getErrorString("webpages.index.login.notallowed")); return Constants.STRUTS_ERROR; } if (!dbuser.getPassword().equals(key)) { log.warn("Username " + dbuser.getUsername() + " use a false password"); - addActionError(LanguageHelper.getErrorString("webpages.index.password.false")); + addActionError(LanguageHelper.getErrorString("webpages.index.login.notallowed")); return Constants.STRUTS_ERROR; } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/UserDatabaseFormValidator.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/UserDatabaseFormValidator.java index 8e6edf52a..276b0b4c8 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/UserDatabaseFormValidator.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/UserDatabaseFormValidator.java @@ -111,6 +111,7 @@ public class UserDatabaseFormValidator { } check = form.getPassword(); + if (MiscUtil.isEmpty(check)) { if (userID == -1) { log.warn("Password is empty"); @@ -124,9 +125,17 @@ public class UserDatabaseFormValidator { } } else { - String key = AuthenticationHelper.generateKeyFormPassword(check); - if (key == null) { - errors.add(LanguageHelper.getErrorString("validation.edituser.password.valid")); + + if (check.equals(form.getPassword_second())) { + + String key = AuthenticationHelper.generateKeyFormPassword(check); + if (key == null) { + errors.add(LanguageHelper.getErrorString("validation.edituser.password.valid")); + } + + } + else { + errors.add(LanguageHelper.getErrorString("validation.edituser.password.equal")); } } 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 06b50ac3c..fa992674e 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 @@ -91,6 +91,36 @@ public class OAGeneralConfigValidation { } } + //check LegacyMode SLTemplates + if (form.isLegacy()) { + if (MiscUtil.isEmpty(form.getSLTemplateURL1()) && + MiscUtil.isEmpty(form.getSLTemplateURL2()) && + MiscUtil.isEmpty(form.getSLTemplateURL3()) ) { + log.info("Empty OA-specific SecurityLayer Templates"); + errors.add(LanguageHelper.getErrorString("validation.general.sltemplates.empty")); + + } else { + check = form.getSLTemplateURL1(); + if (MiscUtil.isNotEmpty(check) && + !ValidationHelper.validateURL(check) ) { + log.info("First OA-specific SecurityLayer Templates is not valid"); + errors.add(LanguageHelper.getErrorString("validation.general.sltemplate1.valid")); + } + check = form.getSLTemplateURL2(); + if (MiscUtil.isNotEmpty(check) && + !ValidationHelper.validateURL(check) ) { + log.info("Second OA-specific SecurityLayer Templates is not valid"); + errors.add(LanguageHelper.getErrorString("validation.general.sltemplate2.valid")); + } + check = form.getSLTemplateURL3(); + if (MiscUtil.isNotEmpty(check) && + !ValidationHelper.validateURL(check) ) { + log.info("Third OA-specific SecurityLayer Templates is not valid"); + errors.add(LanguageHelper.getErrorString("validation.general.sltemplate3.valid")); + } + } + } + //check Mandate Profiles check = form.getMandateProfiles(); if (MiscUtil.isNotEmpty(check)) { diff --git a/id/ConfigWebTool/src/main/resources/applicationResources.properties b/id/ConfigWebTool/src/main/resources/applicationResources.properties index 46f591cb3..0effc6961 100644 --- a/id/ConfigWebTool/src/main/resources/applicationResources.properties +++ b/id/ConfigWebTool/src/main/resources/applicationResources.properties @@ -28,6 +28,7 @@ webpages.index.header=Willkommen bei der MOA-ID 2.x Konfigurationsapplikation webpages.index.desciption.head=Um dieses Service nutzen zu k\u00F6nnen m\u00FCssen sie sich einloggen. webpages.index.login=Anmelden webpages.index.logout=Abmelden +webpages.index.login.notallowed=Entweder sind Benutzername oder Passwort sind nicht korrekt oder der Account wurde noch nicht aktiviert. webpages.index.username.unkown=Der Benutzer ist nicht bekannt. webpages.index.username.notactive=Der Benutzer wurde durch den Administrator noch nicht freigeschalten. webpages.index.password.false=Das Passwort stimmt nicht. @@ -58,6 +59,7 @@ webpages.edituser.mail=EMail Adresse webpages.edituser.access.header=Zugangsdaten webpages.edituser.username=Benutzername webpages.edituser.password=Kennwort +webpages.edituser.password_second=Kennwort wiederholen webpages.edituser.bpk=BPK webpages.edituser.role.header=Rechte und Role webpages.edituser.active=Benutzer ist aktiviert @@ -139,6 +141,10 @@ 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.bku.legacy=Legacy Modus +webpages.oaconfig.general.bku.sltemplate.first=1. SecurityLayer Template +webpages.oaconfig.general.bku.sltemplate.second=2. SecurityLayer Template +webpages.oaconfig.general.bku.sltemplate.third=3. SecurityLayer Template webpages.oaconfig.general.identification=Eindeutiger Identifikatior (PublicURLPrefix) webpages.oaconfig.general.mandate.header=Vollmachten webpages.oaconfig.general.mandate.profiles=Profile @@ -212,6 +218,7 @@ validation.edituser.username.valid=Der Benutzername enth\u00E4lt nicht erlaubte validation.edituser.username.duplicate=Der Benutzername ist bereits vergeben validation.edituser.password.empty=Das Passwort ist leer. validation.edituser.password.valid=Das Passwort konnte nicht in einen g\u00FCltigen Schl\u00FCssel transferiert werden. +validation.edituser.password.equal=Die Passw\u00F6rter sind nicht identisch. validation.edituser.bpk.valid=Die BPK enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0} validation.general.AlternativeSourceID=Die AlternaticeSourceID enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0} @@ -273,6 +280,10 @@ validation.general.oafriendlyname.empty=Es wurde keine Online-Applikation angege validation.general.oafriendlyname=Der Name der Online-Applikation enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0} validation.general.keyboxidentifier.empty=Es wurde kein KeyBoxIdentifier ausgew\u00E4hlt. validation.general.keyboxidentifier.valid=Der KeyBoxIdentifier hat ein ung\u00FCltiges Format. +validation.general.sltemplates.empty=Wenn der Legacymodus verwendet werden soll muss zumindest ein SecurityLayer Template angegeben werden. +validation.general.sltemplate1.valid=Die erste SecurityLayer Template URL hat kein g\u00FCltiges Format. +validation.general.sltemplate2.valid=Die zweite SecurityLayer Template URL hat kein g\u00FCltiges Format. +validation.general.sltemplate3.valid=Die dritte SecurityLayer Template URL hat kein g\u00FCltiges Format. validation.general.mandate.profiles=Die Liste von Vollmachtsprofilen enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0} validation.general.target.empty=Der Target f\u00FCr die Online-Applikation ist leer. validation.general.target.valid=Der Target f\u00FCr die Online-Applikation hat kein g\u00FCltiges Format. diff --git a/id/ConfigWebTool/src/main/webapp/js/common.js b/id/ConfigWebTool/src/main/webapp/js/common.js index 5271a4006..249cb37fa 100644 --- a/id/ConfigWebTool/src/main/webapp/js/common.js +++ b/id/ConfigWebTool/src/main/webapp/js/common.js @@ -52,8 +52,20 @@ function userOA(userid){ $('#selectUserForm_OAID').val(userid); $('#selectUserForm').submit(); } +function oaLegacyService() { + if ($('#OAislegacy').attr('checked') == 'checked') { + + $('#oa_config_sltemplates').css('display', "block"); + + } else { + + $('#oa_config_sltemplates').css('display', "none"); + + } +} function oaOnLoad() { oaBusinessService(); oaSSOService(); + oaLegacyService(); return true; }
\ No newline at end of file diff --git a/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp b/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp index 4d9642130..60f253222 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp @@ -121,20 +121,14 @@ cssClass="textfield_long"> </s:textfield> - <s:textfield name="generalOA.slVersion" - value="%{generalOA.slVersion}" - labelposition="left" - key="webpages.oaconfig.general.bku.slversion" - cssClass="textfield_long"> - </s:textfield> - -<%-- <s:textfield name="generalOA.keyBoxIdentifier" - value="%{generalOA.keyBoxIdentifier}" - labelposition="left" - key="webpages.oaconfig.general.bku.keyboxidentifier" - cssClass="textfield_long"> - </s:textfield> --%> - + <s:if test="authUser.isAdmin()"> + <s:textfield name="generalOA.slVersion" + value="%{generalOA.slVersion}" + labelposition="left" + key="webpages.oaconfig.general.bku.slversion" + cssClass="textfield_long"> + </s:textfield> + </s:if> <s:radio list="generalOA.keyBoxIdentifierList" name="generalOA.keyBoxIdentifier" value="%{generalOA.keyBoxIdentifier}" @@ -142,6 +136,35 @@ key="webpages.oaconfig.general.bku.keyboxidentifier" cssClass="radio"> </s:radio> + <s:checkbox name="generalOA.legacy" + value="%{generalOA.legacy}" + labelposition="left" + key="webpages.oaconfig.general.bku.legacy" + cssClass="checkbox" + onclick="oaLegacyService();" + id="OAislegacy"> + </s:checkbox> + <div id="oa_config_sltemplates"> + <s:textfield name="generalOA.SLTemplateURL1" + value="%{generalOA.SLTemplateURL1}" + labelposition="left" + key="webpages.oaconfig.general.bku.sltemplate.first" + cssClass="textfield_long"> + </s:textfield> + <s:textfield name="generalOA.SLTemplateURL2" + value="%{generalOA.SLTemplateURL2}" + labelposition="left" + key="webpages.oaconfig.general.bku.sltemplate.second" + cssClass="textfield_long"> + </s:textfield> + <s:textfield name="generalOA.SLTemplateURL3" + value="%{generalOA.SLTemplateURL3}" + labelposition="left" + key="webpages.oaconfig.general.bku.sltemplate.third" + cssClass="textfield_long"> + </s:textfield> + </div> + </div> diff --git a/id/ConfigWebTool/src/main/webapp/jsp/edituser.jsp b/id/ConfigWebTool/src/main/webapp/jsp/edituser.jsp index a332fb425..067bcd57d 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/edituser.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/edituser.jsp @@ -93,6 +93,13 @@ cssClass="textfield_long" maxlength="16"> </s:password> + + <s:password name="user.password_second" + labelposition="left" + key="webpages.edituser.password_second" + cssClass="textfield_long" + maxlength="16"> + </s:password> <s:textfield name="user.bpk" value="%{user.bpk}" |