Repository: usergrid Updated Branches: refs/heads/hotfix-20160819 b56701499 -> ef51f3d7b
Use URLs (like admin reset password URL) from properties if they are provided. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/ef51f3d7 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/ef51f3d7 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/ef51f3d7 Branch: refs/heads/hotfix-20160819 Commit: ef51f3d7b15be1000dc03e614afba57d46f17fe0 Parents: b567014 Author: Mike Dunker <mdun...@apigee.com> Authored: Wed Sep 7 16:59:22 2016 -0700 Committer: Mike Dunker <mdun...@apigee.com> Committed: Wed Sep 7 16:59:22 2016 -0700 ---------------------------------------------------------------------- .../management/AccountCreationProps.java | 8 +++++ .../cassandra/OrganizationConfigPropsImpl.java | 38 +++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/usergrid/blob/ef51f3d7/stack/services/src/main/java/org/apache/usergrid/management/AccountCreationProps.java ---------------------------------------------------------------------- diff --git a/stack/services/src/main/java/org/apache/usergrid/management/AccountCreationProps.java b/stack/services/src/main/java/org/apache/usergrid/management/AccountCreationProps.java index 17f2c6a..b1c1148 100644 --- a/stack/services/src/main/java/org/apache/usergrid/management/AccountCreationProps.java +++ b/stack/services/src/main/java/org/apache/usergrid/management/AccountCreationProps.java @@ -54,6 +54,14 @@ public interface AccountCreationProps { String PROPERTIES_EMAIL_USER_PIN_REQUEST = "usergrid.management.email.user-pin"; String PROPERTIES_EMAIL_FOOTER = "usergrid.management.email.footer"; + String PROPERTIES_USER_ACTIVATION_URL = "usergrid.user.activation.url"; + String PROPERTIES_USER_CONFIRMATION_URL = "usergrid.user.confirmation.url"; + String PROPERTIES_USER_RESETPW_URL = "usergrid.user.resetpw.url"; + String PROPERTIES_ADMIN_ACTIVATION_URL = "usergrid.admin.activation.url"; + String PROPERTIES_ADMIN_CONFIRMATION_URL = "usergrid.admin.confirmation.url"; + String PROPERTIES_ORGANIZATION_ACTIVATION_URL = "usergrid.organization.activation.url"; + String PROPERTIES_ADMIN_RESETPW_URL = "usergrid.admin.resetpw.url"; + String PROPERTIES_USERGRID_SYSADMIN_LOGIN_FETCH_ORGS = "usergrid.sysadmin.login.fetch_orgs"; String PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION = http://git-wip-us.apache.org/repos/asf/usergrid/blob/ef51f3d7/stack/services/src/main/java/org/apache/usergrid/management/cassandra/OrganizationConfigPropsImpl.java ---------------------------------------------------------------------- diff --git a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/OrganizationConfigPropsImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/OrganizationConfigPropsImpl.java index 5d2c256..adfadf2 100644 --- a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/OrganizationConfigPropsImpl.java +++ b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/OrganizationConfigPropsImpl.java @@ -17,6 +17,7 @@ package org.apache.usergrid.management.cassandra; +import org.apache.usergrid.management.AccountCreationProps; import org.apache.usergrid.management.OrganizationConfigProps; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -206,10 +207,45 @@ public class OrganizationConfigPropsImpl implements OrganizationConfigProps { orgProperties.put(name,value); } + protected String getWorkflowUrlOverrideProperty(WorkflowUrl urlType) { + String propertyName = null; + switch (urlType) { + case ORGANIZATION_ACTIVATION_URL: + propertyName = AccountCreationProps.PROPERTIES_ORGANIZATION_ACTIVATION_URL; + break; + case ADMIN_ACTIVATION_URL: + propertyName = AccountCreationProps.PROPERTIES_ADMIN_ACTIVATION_URL; + break; + case ADMIN_CONFIRMATION_URL: + propertyName = AccountCreationProps.PROPERTIES_ADMIN_CONFIRMATION_URL; + break; + case ADMIN_RESETPW_URL: + propertyName = AccountCreationProps.PROPERTIES_ADMIN_RESETPW_URL; + break; + case USER_ACTIVATION_URL: + propertyName = AccountCreationProps.PROPERTIES_USER_ACTIVATION_URL; + break; + case USER_CONFIRMATION_URL: + propertyName = AccountCreationProps.PROPERTIES_USER_CONFIRMATION_URL; + break; + case USER_RESETPW_URL: + propertyName = AccountCreationProps.PROPERTIES_USER_RESETPW_URL; + break; + default: + return null; + } + + return getProperty(propertyName); + } + @Override public String getFullUrlTemplate(WorkflowUrl urlType) { String urlTemplate = null; - if (urlPaths.containsKey(urlType)) { + String propertyValue = getWorkflowUrlOverrideProperty(urlType); + if (propertyValue != null) { + urlTemplate = propertyValue; + } + else if (urlPaths.containsKey(urlType)) { urlTemplate = getProperty(ORGPROPERTIES_API_URL_BASE) + urlPaths.get(urlType); } return urlTemplate;