Second pass fixing 70+ references across 32 files: - Orders: DeliveryMultiplier→BusinessDeliveryMultiplier, OrderTipAmount→TipAmount, OrderPaymentCompletedOn→PaymentCompletedOn, OrderPaymentError→PaymentError - Orders PK: WHERE OrderID=? → WHERE ID=? on Orders table - OrderLineItems PK: OrderLineItemID→ID in INSERT, WHERE, and query results - Items: parent.ItemID→parent.ID in JOIN conditions - Tasks: t.TaskID→t.ID in JOIN conditions - Users PK: WHERE UserID=X → WHERE ID=X on Users table - Addresses PK: A.AddressID→A.ID in JOIN conditions - tt_States: tt_StateID→ID, remove nonexistent tt_StateCountryID/tt_StateSortOrder - tt_OrderTypes: tt_OrderTypeID→ID, tt_OrderTypeName→Name - tt_Days: D.tt_DayID→D.ID - confirm_email.cfm: Add missing SELECT/FROM to queries - setLineItem.cfm: Fix 13 old column references - Stripe webhook/payment: Fix column names and PK references Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
112 lines
3.6 KiB
Text
112 lines
3.6 KiB
Text
<!--- <cfoutput>
|
|
#form.UUID#<br>
|
|
#form.OTP#
|
|
</cfoutput> --->
|
|
|
|
<cfparam name="form.mode" default="confirm">
|
|
|
|
<cfquery name="check_valid" datasource="#application.datasource#" dbtype="ODBC">
|
|
SELECT ID, IsEmailVerified, EmailAddress
|
|
FROM Users
|
|
WHERE UUID = '#form.UUID#'
|
|
AND
|
|
MobileVerifyCode = '#form.OTP#'
|
|
AND
|
|
IsContactVerified = 0
|
|
AND
|
|
IsEmailVerified = 0
|
|
</cfquery>
|
|
|
|
<cfif check_valid.recordcount EQ 1>
|
|
|
|
<cfquery name="confirm_mobile" datasource="#application.datasource#" dbtype="ODBC">
|
|
UPDATE Users
|
|
SET IsContactVerified = 1
|
|
WHERE ID = #check_valid.ID#
|
|
</cfquery>
|
|
|
|
<cfif check_valid.IsEmailVerified eq 1>
|
|
|
|
You're now fully verified and ready to use Payfrit!<br><br>
|
|
|
|
Click HERE to login and order.<br>
|
|
|
|
<cfelse>
|
|
|
|
OTP verified, please check your email <cfoutput>#check_valid.EmailAddress#</cfoutput><br><br>
|
|
|
|
There's a link there for you to click, then you can login to Payfrit!<BR>
|
|
|
|
</cfif>
|
|
|
|
<cfelse>
|
|
|
|
<cfquery name="check_valid_with_email_confirmed" datasource="#application.datasource#" dbtype="ODBC">
|
|
SELECT ID, IsEmailVerified, EmailAddress
|
|
FROM Users
|
|
WHERE UUID = '#form.UUID#'
|
|
AND
|
|
MobileVerifyCode = '#form.OTP#'
|
|
AND
|
|
IsContactVerified = 0
|
|
AND
|
|
IsEmailVerified = 1
|
|
</cfquery>
|
|
|
|
<cfif check_valid_with_email_confirmed.recordcount eq 1>
|
|
|
|
<cfquery name="confirm_mobile" datasource="#application.datasource#" dbtype="ODBC">
|
|
UPDATE Users
|
|
SET IsContactVerified = 1
|
|
WHERE ID = #check_valid_with_email_confirmed.ID#
|
|
</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 = #check_valid_with_email_confirmed.ID#>
|
|
<!--- 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="#check_valid_with_email_confirmed.EmailAddress#"
|
|
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">buy some stuff!</a></cfoutput><br>
|
|
|
|
<cflocation url="index.cfm?userstatus=new">
|
|
|
|
<cfelse>
|
|
|
|
<cfquery name="check_valid" datasource="#application.datasource#" dbtype="ODBC">
|
|
SELECT ID, IsEmailVerified
|
|
FROM Users
|
|
WHERE UUID = '#form.UUID#'
|
|
AND
|
|
IsContactVerified = 0
|
|
</cfquery>
|
|
|
|
<cfif check_valid.recordcount eq 1>
|
|
|
|
OTP is incorrect, please re-check the code we sent you<br><br>
|
|
|
|
<cfelse>
|
|
|
|
Problem!<br><br>
|
|
|
|
please <a href="register.cfm">try again</a><br>
|
|
|
|
</cfif>
|
|
|
|
</cfif>
|
|
|
|
</cfif>
|
|
|