120 lines
No EOL
4.1 KiB
Text
120 lines
No EOL
4.1 KiB
Text
<cfparam name="url.UUID" default="0">
|
|
|
|
<cfparam name="session.Userid" default="0">
|
|
<cfparam name="request.Userid" default="0">
|
|
<cfset session.Userid = 0>
|
|
<cfset request.Userid = 0>
|
|
|
|
<cfquery name="get_user" datasource="#application.datasource#">
|
|
SELECT UserID, UserEmailAddress
|
|
FROM Users
|
|
WHERE UserUUID = '#url.UUID#'
|
|
AND
|
|
UserIsEmailVerified = 0
|
|
AND
|
|
UserIsContactVerified > 0
|
|
</cfquery>
|
|
|
|
<cfif get_user.recordcount EQ 1>
|
|
|
|
<cfquery name="update_User" datasource="#application.datasource#">
|
|
UPDATE Users
|
|
SET UserIsEmailVerified = 1
|
|
WHERE UserID = '#get_user.UserID#'
|
|
</cfquery>
|
|
|
|
<!--- might as well log them in since they confirmed successfully, probably a bad idea but not worried about it for now --->
|
|
|
|
<!--- Update the session variables and request variables --->
|
|
<cflock timeout="60" throwontimeout="Yes" type="EXCLUSIVE" scope="SESSION">
|
|
<cfset session.UserID = #get_user.UserID#>
|
|
<!--- Re-duplicate them --->
|
|
<cfset request.UserID = Duplicate(session.UserID)>
|
|
</cflock>
|
|
|
|
<cfmodule template="#application.wwwrootprefix#modules/notifier.cfm"
|
|
domain="box.payfrit.com"
|
|
from_email="admin@payfrit.com"
|
|
to_email="#get_user.UserEmailAddress#"
|
|
subject="Welcome to Payfrit!"
|
|
email_body="Thanks for confirming your Payfrit account! Go order food!"
|
|
>
|
|
|
|
ok your account is all confirmed and you are logged in!<br><br>
|
|
|
|
it's time to go <cfoutput><a href="#application.httpsprefix#index.cfm">check out Payfrit!</a></cfoutput><br>
|
|
|
|
<cflocation url="index.cfm?userstatus=new">
|
|
|
|
<cfelse>
|
|
|
|
<cfquery name="get_confirmed_customer" datasource="#application.datasource#">
|
|
SELECT UserID, UserContactNumber
|
|
FROM Users
|
|
WHERE UserUUID = '#url.UUID#'
|
|
AND
|
|
UserIsEmailVerified = 0
|
|
AND
|
|
UserIsContactVerified = 0
|
|
</cfquery>
|
|
|
|
<cfif get_confirmed_customer.recordcount EQ 1>
|
|
|
|
<cfquery name="update_User" datasource="#application.datasource#">
|
|
UPDATE Users
|
|
SET UserIsEmailVerified = 1
|
|
WHERE UserID = '#get_confirmed_customer.UserID#'
|
|
</cfquery>
|
|
|
|
your email was confirmed but we still need to verify your mobile number!<br><br>
|
|
|
|
<cfset customer_OPT_confirm = round(rand()*899996+100000)>
|
|
|
|
<cfquery name="update_OPT_confirm" datasource="#application.datasource#">
|
|
UPDATE Users
|
|
SET UserMobileVerifyCode = '#customer_OPT_confirm#'
|
|
WHERE UserID = #get_confirmed_customer.UserID#
|
|
</cfquery>
|
|
|
|
we sent a six-digit code to <cfoutput>#get_confirmed_customer.UserContactNumber#</cfoutput>, please input that code here:<br><br>
|
|
|
|
<script language="JavaScript">
|
|
function submitformconfirmmobile()
|
|
{
|
|
document.myformconfirmmobile.submit();
|
|
}
|
|
</script>
|
|
|
|
<form action="confirm_mobile.cfm" method="post" name="myformconfirmmobile" id="myformconfirmmobile" style="display:inline;">
|
|
|
|
<input type="text" size="5" maxlength="6" name="OTP"> <a href="javascript: submitformconfirmmobile()">confirm mobile</a>
|
|
|
|
<cfoutput><input type="hidden" name="UUID" value="#url.UUID#"></cfoutput>
|
|
<input type="hidden" name="mode" value="confirm">
|
|
|
|
</form>
|
|
|
|
<script language="JavaScript">
|
|
function submitformconfirmmobile1()
|
|
{
|
|
document.myformconfirmmobile1.submit();
|
|
}
|
|
</script>
|
|
|
|
<form action="register.cfm" method="post" name="myformconfirmmobile1" id="myformconfirmmobile1" style="display:inline;">
|
|
|
|
<a href="javascript: submitformconfirmmobile1()">didn't get the code?</a>
|
|
|
|
<input type="hidden" name="UUID" value="#UUID_to_insert#">
|
|
<input type="hidden" name="mode" value="manual_confirm">
|
|
<input type="hidden" name="register_form_submitted" value="0">
|
|
|
|
</form><br><br>
|
|
|
|
<cfelse>
|
|
|
|
you shouldn't be here, <a href="mailto:admin@payfrit.com">email</a> us if you need help with something.<br>
|
|
|
|
</cfif>
|
|
|
|
</cfif> |