diff options
Diffstat (limited to 'id/moa-id-webgui/src/main/java')
-rw-r--r-- | id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/GeneralMOAIDConfigurationTask.java | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/GeneralMOAIDConfigurationTask.java b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/GeneralMOAIDConfigurationTask.java index 891295777..1c3e0fe13 100644 --- a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/GeneralMOAIDConfigurationTask.java +++ b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/GeneralMOAIDConfigurationTask.java @@ -29,6 +29,7 @@ import java.util.List; import java.util.Map; import java.util.regex.Pattern; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -114,17 +115,32 @@ public class GeneralMOAIDConfigurationTask extends AbstractTaskValidator impleme } check = input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_PUBLICURLPREFIX, getKeyPrefix())); + String isVirtualIDPEnabled = input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_ISVIRTUALIDPSENABLED, getKeyPrefix())); if (MiscUtil.isNotEmpty(check)) { String[] preFixList = check.split(","); - for (String el : preFixList) { - if (!ValidationHelper.validateURL(el.trim())) { - log.info("Public URL Prefix is not valid"); + if (isVirtualIDPEnabled != null && Boolean.valueOf(isVirtualIDPEnabled)) { + for (String el : preFixList) { + if (!ValidationHelper.validateURL(el.trim())) { + log.info("Public URL Prefix is not valid"); + errors.add(new ValidationObjectIdentifier( + MOAIDConfigurationConstants.GENERAL_PUBLICURLPREFIX, + "Public URL Prefix", + LanguageHelper.getErrorString("validation.general.publicURLprefix.valid", new Object[]{el}))); + } + } + } else { + if (!ValidationHelper.validateURL( + StringUtils.chomp(preFixList[0].trim()))) { + log.info("Public URL Prefix " + preFixList[0] + " is not valid"); errors.add(new ValidationObjectIdentifier( MOAIDConfigurationConstants.GENERAL_PUBLICURLPREFIX, "Public URL Prefix", - LanguageHelper.getErrorString("validation.general.publicURLprefix.valid", new Object[]{el}))); + LanguageHelper.getErrorString("validation.general.publicURLprefix.valid", new Object[]{preFixList[0]}))); + } + } + } else { log.info("PublicURL Prefix is empty."); errors.add(new ValidationObjectIdentifier( |