add reset_url as field in admin confirmation email

Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/173be8a4
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/173be8a4
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/173be8a4

Branch: refs/heads/asf-site
Commit: 173be8a4b968eda617f73a3baf05fa7870594657
Parents: 7f40d68
Author: Mike Dunker <mdun...@google.com>
Authored: Fri Sep 22 14:51:55 2017 -0700
Committer: Mike Dunker <mdun...@google.com>
Committed: Tue Sep 26 08:09:04 2017 -0700

----------------------------------------------------------------------
 .../management/cassandra/ManagementServiceImpl.java    | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/173be8a4/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
 
b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
index 2302d8d..ab93563 100644
--- 
a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
+++ 
b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
@@ -2680,10 +2680,17 @@ public class ManagementServiceImpl implements 
ManagementService {
             String token = getConfirmationTokenForAdminUser(user.getUuid(), 0, 
organizationId);
             OrganizationConfig orgConfig = organizationId != null ?
                 getOrganizationConfigByUuid(organizationId) : 
getOrganizationConfigForUserInfo(user);
-            String confirmation_url = 
orgConfig.getFullUrl(WorkflowUrl.ADMIN_CONFIRMATION_URL,
-                user.getUuid().toString()) + "?token=" + token;
+            String confirmation_url = 
orgConfig.getFullUrl(WorkflowUrl.ADMIN_CONFIRMATION_URL, 
user.getUuid().toString()) +
+                "?token=" + token;
+
+            String reset_token = getPasswordResetTokenForAdminUser( 
user.getUuid(), 0, organizationId );
+            String resetPropertyUrl = 
orgConfig.getFullUrlTemplate(WorkflowUrl.ADMIN_RESETPW_URL);
+            String reset_url = String.format(resetPropertyUrl, 
user.getUuid().toString())
+                + "?token=" + reset_token;
+
             sendAdminUserEmail(user, "User Account Confirmation: " + 
user.getEmail(),
-                emailMsg(hashMap("confirm_email", 
user.getEmail()).map("confirmation_url", confirmation_url),
+                emailMsg(hashMap("confirm_email", 
user.getEmail()).map("confirmation_url", confirmation_url)
+                    .map("reset_url", reset_url),
                     PROPERTIES_EMAIL_ADMIN_CONFIRMATION));
     }
 

Reply via email to