-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathreset-pass.rsp
More file actions
82 lines (80 loc) · 1.77 KB
/
reset-pass.rsp
File metadata and controls
82 lines (80 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<%
err?: denied?: reset-ok?: no
fLogin: fEmail: ""
params: request/content
either "ok" = select params 'reset [
reset-ok?: yes
][
if all [
none? validate/full [action word! *]
'reset = params/action
][
either invalid: validate/full [
login - *
email email! *
][
err?: yes
][
if not denied?: say any [
all [
not find params/email #"@"
"Invalid email address"
]
all [
"Unknown user" = res: check-user params
"These Login/Email don't match"
]
][
send-reset-URL params res/1
response/redirect "reset-pass.rsp?reset=ok"
]
]
fLogin: any [params/login fLogin]
fEmail: any [params/email fEmail]
]
]
title: say "Reset your Password"
include %head.rsp
%>
<%either reset-ok? [%>
<div align="center">
<p>
#[An email has been sent with an confirmation URL].<br>
#[Once activated, you can freely log in here with your new password].
</p>
</div>
<%][%>
<div align="center" style="padding-top:40px">
<form method="POST" action="reset-pass.rsp">
<%if err? [%>
<font color="red"><b>#[Error: Missing fields or incorrect values]</b></font>
<%]%>
<%if denied? [%>
<font color="red"><b>#[Error]: <%=denied?%>!</b></font>
<%]%>
<table class="align-right">
<tr>
<th <% if err? [mark/error 'login] %>>#[User ID]</th>
<td>
<input type="text" name="login" value="<%=fLogin%>">
</td>
</tr>
<tr>
<th <% if err? [mark/error 'email] %>>#[Email]</th>
<td>
<input type="text" name="email" value="<%=fEmail%>">
</td>
</tr>
<tr>
<td></td>
<td>
<br>
<input type="submit" value="#[Reset Password]">
</td>
</tr>
</table>
<input type="hidden" name="action" value="reset">
</form>
</div>
<%]%>
<%include-file %footer.inc%>