|
- <%
- Class OrderController_Class
- Private m_useLayout
- Private m_title
-
- Private Sub Class_Initialize()
- m_useLayout = True
- m_title = "Your Order"
- End Sub
-
- Public Property Get useLayout
- useLayout = m_useLayout
- End Property
-
- Public Property Let useLayout(v)
- m_useLayout = v
- End Property
-
- Public Property Get Title
- Title = m_title
- End Property
-
- Public Property Let Title(v)
- m_title = v
- End Property
-
- '-------------------------------------------------------------------------------------------------------------------
- ' GET: verify the token from the emailed link and continue the order.
- ' The order form itself is a placeholder for now - this only confirms the token is valid.
- '-------------------------------------------------------------------------------------------------------------------
- Public Sub Continue()
- Dim token, order, isValid, csrfToken
- token = Trim(Request.QueryString("token"))
- isValid = False
- csrfToken = ""
- Set order = Nothing
-
- If Len(token) > 0 Then
- Set order = OrdersRepository().FindByToken(token)
- If Not (order Is Nothing) Then
- If IsNull(order("TokenUsedAt")) And order("TokenExpiresAt") >= Now() Then
- isValid = True
- OrdersRepository().MarkTokenUsed order("OrderID")
- End If
- End If
- End If
-
- If isValid Then csrfToken = HTMLSecurity().GetAntiCSRFToken("Order.Continue")
- %>
- <!--#include file="../views/Order/continue.asp" -->
- <%
- End Sub
-
- End Class
-
- Dim OrderController_Class__Singleton
- Function OrderController()
- If IsEmpty(OrderController_Class__Singleton) Then
- Set OrderController_Class__Singleton = New OrderController_Class
- End If
- Set OrderController = OrderController_Class__Singleton
- End Function
- %>
|