diff options
author | Florian Reimair <florian.reimair@iaik.tugraz.at> | 2014-01-07 13:48:06 +0100 |
---|---|---|
committer | Florian Reimair <florian.reimair@iaik.tugraz.at> | 2014-01-27 16:34:14 +0100 |
commit | 7c39d9e0cff15a87678bf68d6d754ee1e720ca12 (patch) | |
tree | 5f0c652ade251d04e61fda97a0ad01e9b480f139 /id/ConfigWebTool/src | |
parent | bb32dd1f8978907c57beedfb490229b39a77e8df (diff) | |
download | moa-id-spss-7c39d9e0cff15a87678bf68d6d754ee1e720ca12.tar.gz moa-id-spss-7c39d9e0cff15a87678bf68d6d754ee1e720ca12.tar.bz2 moa-id-spss-7c39d9e0cff15a87678bf68d6d754ee1e720ca12.zip |
attr table in global config
Diffstat (limited to 'id/ConfigWebTool/src')
4 files changed, 29 insertions, 24 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java index 8b527aa8f..695caa3fd 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java @@ -1,7 +1,6 @@ package at.gv.egovernment.moa.id.configuration.data; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; @@ -66,14 +65,12 @@ public class GeneralStorkConfig { return tmp; } - public String getDefaultAttributes() { - return Arrays.toString(attributes.toArray()).replace("[", "").replace("]", ""); + public List<String> getAttributes() { + return attributes; } - public void setDefaultAttributes(String attributes) { - this.attributes = new ArrayList<String>(); - for(String current : attributes.split(",")) - this.attributes.add(current.trim()); + public void setAttributes(List<String> attributes) { + this.attributes = attributes; } public int getDefaultQaa() { diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java index 730466e15..cc5d0f2c4 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java @@ -64,18 +64,23 @@ public class StorkConfigValidator { } // check attributes - String check = form.getDefaultAttributes(); - if (MiscUtil.isNotEmpty(check)) { - if (ValidationHelper.containsPotentialCSSCharacter(check, true)) { - log.warn("default attributes contains potentail XSS characters: " + check); - errors.add(LanguageHelper.getErrorString("validation.stork.requestedattributes", - new Object[] {ValidationHelper.getPotentialCSSCharacter(true)} )); - } - if(!check.toLowerCase().matches("^[a-z0-9, ]*$")) { - log.warn("default attributes do not match the requested format : " + check); + if (MiscUtil.isNotEmpty(form.getAttributes())) { + for(String check : form.getAttributes()) { + if (ValidationHelper.containsPotentialCSSCharacter(check, true)) { + log.warn("default attributes contains potentail XSS characters: " + check); errors.add(LanguageHelper.getErrorString("validation.stork.requestedattributes", - new Object[] {check} )); + new Object[] {ValidationHelper.getPotentialCSSCharacter(true)} )); + } + if(!check.toLowerCase().matches("^[a-z0-9]*$")) { + log.warn("default attributes do not match the requested format : " + check); + errors.add(LanguageHelper.getErrorString("validation.stork.requestedattributes", + new Object[] {check} )); + } } + } else { + log.warn("no attributes specified"); + errors.add(LanguageHelper.getErrorString("validation.stork.attributes.empty", + new Object[] {} )); } return errors; diff --git a/id/ConfigWebTool/src/main/resources/applicationResources.properties b/id/ConfigWebTool/src/main/resources/applicationResources.properties index 0ac4b2cbc..14f282c85 100644 --- a/id/ConfigWebTool/src/main/resources/applicationResources.properties +++ b/id/ConfigWebTool/src/main/resources/applicationResources.properties @@ -227,9 +227,8 @@ webpages.oaconfig.stork.usestork=STORK Logon aktivieren webpages.moaconfig.stork.pepslist=C-PEPS Konfiguration webpages.moaconfig.stork.newpeps=Neuen PEPS konfigurieren webpages.moaconfig.stork.removepeps=l\u00F6schen -webpages.moaconfig.stork.requestedattributes.default=Standardattribute, die von STORK angefordert werden webpages.moaconfig.stork.qaa.default=Standard QAA-Level ausw\u00E4hlen -webpages.moaconfig.stork.requestedattributes=Attribute, die von STORK angefordert werden +webpages.moaconfig.stork.attributes.heading=Attributkonfiguration webpages.moaconfig.stork.qaa=Mindest-QAA-Level f\u00FCr diese OA ausw\u00E4hlen webpages.oaconfig.protocols.saml1.header=SAML1 Konfiguration @@ -379,6 +378,7 @@ validation.stork.cpeps.empty=CPEPS Konfiguration ist unvollst\u00E4ndig validation.stork.cpeps.url=CPEPS URL ist ung\u00FCltig validation.stork.requestedattributes=STORK Attribute sind fehlerhaft. Bsp.: attr1, attr2 validation.stork.qaa.outofrange=Gültige QAA Werte sind 1, 2, 3, und 4 +validation.stork.attributes.empty=Es muss mindestens ein Attribut definiert sein validation.pvp2.metadataurl.empty=Keine Metadaten URL angegeben. validation.pvp2.metadataurl.valid=Die Metadaten URL wei\u00DFt kein g\u00FCltiges URL Format auf. diff --git a/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp b/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp index df6a43e7a..aff2028ac 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp @@ -228,11 +228,6 @@ <div class="oa_config_block"> <h3><%=LanguageHelper.getGUIString("webpages.oaconfig.stork.header", request) %></h3> - <s:textfield name="storkconfig.defaultAttributes" - value="%{storkconfig.defaultAttributes}" - labelposition="left" - key="webpages.moaconfig.stork.requestedattributes.default" - cssClass="textfield_long"/> <s:select list="#{1:'1', 2:'2', 3:'3', 4:'4'}" value="#{storkconfig.defaultQaa}" name="storkconfig.defaultQaa" @@ -248,6 +243,14 @@ </s:iterator> </table> <input type="button" value="<%=LanguageHelper.getGUIString("webpages.moaconfig.stork.newpeps", request) %>" onclick='newPeps();' /> + <h4><%=LanguageHelper.getGUIString("webpages.moaconfig.stork.attributes.heading", request) %></h4> + <table> + <tr><th>Attribute Name</th></tr> + <s:iterator value="storkconfig.attributes" var="attr" status="stat"> + <tr><td><s:textfield name="storkconfig.attributes[%{#stat.index}]"/></td> + <td><input type="button" value="Delete" onclick='this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);'/></td></tr> + </s:iterator> + </table> </div> <div class="oa_config_block"> |