Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

71 lignes
2.3KB

  1. <%
  2. Class OrderController_Class
  3. Private m_useLayout
  4. Private m_title
  5. Private Sub Class_Initialize()
  6. m_useLayout = True
  7. m_title = "Your Order"
  8. End Sub
  9. Public Property Get useLayout
  10. useLayout = m_useLayout
  11. End Property
  12. Public Property Let useLayout(v)
  13. m_useLayout = v
  14. End Property
  15. Public Property Get Title
  16. Title = m_title
  17. End Property
  18. Public Property Let Title(v)
  19. m_title = v
  20. End Property
  21. '-------------------------------------------------------------------------------------------------------------------
  22. ' GET: verify the token from the emailed link and continue the order.
  23. ' The order form itself is a placeholder for now - this only confirms the token is valid.
  24. '-------------------------------------------------------------------------------------------------------------------
  25. Public Sub Continue()
  26. Dim token, order, isValid, csrfToken, municipalityName
  27. token = Trim(Request.QueryString("token"))
  28. isValid = False
  29. csrfToken = ""
  30. municipalityName = ""
  31. Set order = Nothing
  32. If Len(token) > 0 Then
  33. Set order = OrdersRepository().FindByToken(token)
  34. If Not (order Is Nothing) Then
  35. If IsNull(order("TokenUsedAt")) And order("TokenExpiresAt") >= Now() Then
  36. isValid = True
  37. OrdersRepository().MarkTokenUsed order("OrderID")
  38. End If
  39. End If
  40. End If
  41. If isValid Then
  42. csrfToken = HTMLSecurity().GetAntiCSRFToken("Order.Continue")
  43. ' Look up the municipality from the same jurisdiction list the number was
  44. ' already validated against at /request-order - "" means no match (cache empty
  45. ' or code not found), and the view falls back to a manually-entered field.
  46. municipalityName = GetJurisdictionName(order("JurisdictionNumber"))
  47. End If
  48. %>
  49. <!--#include file="../views/Order/continue.asp" -->
  50. <%
  51. End Sub
  52. End Class
  53. Dim OrderController_Class__Singleton
  54. Function OrderController()
  55. If IsEmpty(OrderController_Class__Singleton) Then
  56. Set OrderController_Class__Singleton = New OrderController_Class
  57. End If
  58. Set OrderController = OrderController_Class__Singleton
  59. End Function
  60. %>

Powered by TurnKey Linux.