From cfbc022169d731459538bec87381fdcdff313a3b Mon Sep 17 00:00:00 2001 From: Tom Ladendorf Date: Thu, 8 Jan 2015 16:45:47 -0600 Subject: [PATCH 1/4] Added param for destination for activation --- actions/memberRegistration.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/actions/memberRegistration.js b/actions/memberRegistration.js index 6564ae4e9..7fb9ae151 100644 --- a/actions/memberRegistration.js +++ b/actions/memberRegistration.js @@ -396,6 +396,9 @@ var registerUser = function (user, api, dbConnectionMap, next) { function (callback) { var url; url = process.env.TC_ACTIVATION_SERVER_NAME + '/reg2/activate.action?code=' + activationCode; + if (regSource.match(/arena/) { + url += '&destination=http%3A%2F%2Farena.topcoder.com' + }) api.log("Activation url: " + url, "debug"); api.tasks.enqueue("sendEmail", {subject : activationEmailSubject, activationCode : activationCode, template : 'activation_email', toAddress : user.email, fromAddress : process.env.TC_EMAIL_ACCOUNT, senderName : activationEmailSenderName, url : url, userHandle : user.handle}, 'default'); From 544c60724859a3040c89b623648df9c592796c90 Mon Sep 17 00:00:00 2001 From: Tom Ladendorf Date: Tue, 20 Jan 2015 19:26:11 -0600 Subject: [PATCH 2/4] Fixed arena link --- actions/memberRegistration.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/actions/memberRegistration.js b/actions/memberRegistration.js index 7fb9ae151..d68cc5a99 100644 --- a/actions/memberRegistration.js +++ b/actions/memberRegistration.js @@ -396,9 +396,9 @@ var registerUser = function (user, api, dbConnectionMap, next) { function (callback) { var url; url = process.env.TC_ACTIVATION_SERVER_NAME + '/reg2/activate.action?code=' + activationCode; - if (regSource.match(/arena/) { - url += '&destination=http%3A%2F%2Farena.topcoder.com' - }) + if (regSource.match(/arena/)) { + url += '&destination=http%3A%2F%2Farena.topcoder.com'; + } api.log("Activation url: " + url, "debug"); api.tasks.enqueue("sendEmail", {subject : activationEmailSubject, activationCode : activationCode, template : 'activation_email', toAddress : user.email, fromAddress : process.env.TC_EMAIL_ACCOUNT, senderName : activationEmailSenderName, url : url, userHandle : user.handle}, 'default'); From e3f77c0e8e5d31df130007a619b125858edeabaa Mon Sep 17 00:00:00 2001 From: Tom Ladendorf Date: Tue, 20 Jan 2015 19:26:59 -0600 Subject: [PATCH 3/4] Added undefined check --- actions/memberRegistration.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/memberRegistration.js b/actions/memberRegistration.js index d68cc5a99..825c8d122 100644 --- a/actions/memberRegistration.js +++ b/actions/memberRegistration.js @@ -396,7 +396,7 @@ var registerUser = function (user, api, dbConnectionMap, next) { function (callback) { var url; url = process.env.TC_ACTIVATION_SERVER_NAME + '/reg2/activate.action?code=' + activationCode; - if (regSource.match(/arena/)) { + if (regSource && regSource.match(/arena/)) { url += '&destination=http%3A%2F%2Farena.topcoder.com'; } api.log("Activation url: " + url, "debug"); From 4d1c1fc8697241a503c5983fdd8604f5eede41df Mon Sep 17 00:00:00 2001 From: Tom Ladendorf Date: Tue, 20 Jan 2015 20:10:50 -0600 Subject: [PATCH 4/4] fixed regsource check --- actions/memberRegistration.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/memberRegistration.js b/actions/memberRegistration.js index 825c8d122..f95e0e1f4 100644 --- a/actions/memberRegistration.js +++ b/actions/memberRegistration.js @@ -396,7 +396,7 @@ var registerUser = function (user, api, dbConnectionMap, next) { function (callback) { var url; url = process.env.TC_ACTIVATION_SERVER_NAME + '/reg2/activate.action?code=' + activationCode; - if (regSource && regSource.match(/arena/)) { + if (user.regSource && user.regSource.match(/arena/)) { url += '&destination=http%3A%2F%2Farena.topcoder.com'; } api.log("Activation url: " + url, "debug");