|
0
|
1 local Luan = require "luan:Luan.luan"
|
|
|
2 local error = Luan.error
|
|
|
3 local Html = require "luan:Html.luan"
|
|
|
4 local html_encode = Html.encode or error()
|
|
|
5 local Io = require "luan:Io.luan"
|
|
|
6 local Http = require "luan:http/Http.luan"
|
|
|
7 local Shared = require "site:/lib/Shared.luan"
|
|
|
8 local head = Shared.head or error()
|
|
|
9 local page_header = Shared.page_header or error()
|
|
|
10 local footer = Shared.footer or error()
|
|
|
11 local User = require "site:/lib/User.luan"
|
|
|
12 local Logging = require "luan:logging/Logging.luan"
|
|
|
13 local logger = Logging.logger "register2.html"
|
|
|
14
|
|
|
15
|
|
|
16 return function()
|
|
|
17 local user_name = Http.request.parameters.user
|
|
|
18 if user_name == nil then
|
|
|
19 Http.response.send_redirect "/register.html"
|
|
|
20 return
|
|
|
21 end
|
|
|
22 local code = Http.request.parameters.code or ""
|
|
|
23 local user = User.get_by_name(user_name) or error()
|
|
|
24 Io.stdout = Http.response.text_writer()
|
|
|
25 %>
|
|
|
26 <!doctype html>
|
|
|
27 <html lang="en">
|
|
|
28 <head>
|
|
|
29 <% head() %>
|
|
|
30 <title>Link My Style</title>
|
|
|
31 <style>
|
|
|
32 div[right_of_page] {
|
|
|
33 background-image: url(/images/bag.jpg);
|
|
|
34 }
|
|
|
35 p[info] {
|
|
|
36 color: #808080 !important;
|
|
|
37 }
|
|
|
38 [spam] {
|
|
|
39 font-weight: bold;
|
|
|
40 color: #ad1f00;
|
|
|
41 }
|
|
|
42 </style>
|
|
|
43 </head>
|
|
|
44 <body>
|
|
|
45 <form page onsubmit="ajaxForm('/register2.js',this)" action="javascript:">
|
|
|
46 <% page_header() %>
|
|
|
47 <div>
|
|
|
48 <input type=hidden name="user" value="<%=user_name%>">
|
|
|
49 <h1>Enter confirmation code</h1>
|
|
|
50 <p info>To verify your account, enter the six digit code we sent to <%=html_encode(user.email)%>. <span spam>If you do not see our email, please check your spam folder for the email and report not spam.</span></p>
|
|
|
51 <input type=text required name=code value="<%=code%>" placeholder="Enter 6-digit code" autofocus>
|
|
|
52 <div error=code></div>
|
|
|
53 <button type=submit big>Continue</button>
|
|
|
54 </div>
|
|
|
55 <% footer() %>
|
|
|
56 </form>
|
|
|
57 <div right_of_page></div>
|
|
|
58 </body>
|
|
|
59 </html>
|
|
|
60 <%
|
|
|
61 end
|