forked from TezosRio/taps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reset.cfm
executable file
·180 lines (152 loc) · 5.96 KB
/
reset.cfm
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<cfif not isUserLoggedIn()>
<cflocation url="index.cfm">
</cfif>
<cfscript>
setLocale("English (us)");
</cfscript>
<cfset reset="no">
<cfset passdw="">
<cfset passdw2="">
<cfset resultReset=false>
<cfif #isDefined('form.reset')#>
<cfset reset="#form.reset#">
</cfif>
<cfif #isDefined('form.passdw')#>
<cfset passdw="#form.passdw#">
</cfif>
<cfif #isDefined('form.passdw2')#>
<cfset passdw2="#form.passdw2#">
</cfif>
<cfif reset EQ "yes">
<cfinvoke component="components.taps" method="resetTaps" user="#application.user#" passdw="#passdw#" passdw2="#passdw2#" returnVariable="resultReset">
<cfelse>
<cfset resultReset=false>
</cfif>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="cache-control" content="no-cache">
<!-- CSS Bootstrap-->
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<!-- CSS Page-->
<link rel="stylesheet" type="text/css" href="css/estilo.css">
<script src="js/jquery-3.2.1.min.js"></script>
<script language="javascript">
function validate()
{
if (document.getElementById('idPassdw').value == '')
{
return false;
}
if (document.getElementById('idPassdw2').value == '')
{
return false;
}
if (document.getElementById('idPassdw').value != document.getElementById('idPassdw2').value)
{
return false;
}
if (!confirm('This will do a factory reset and erase all data, including configured wallets. Do you really want to RESET taps?'))
return false;
return true;
}
function showError()
{
document.getElementById('idError').style.visibility = "visible";
document.getElementById('idPassdw').focus();
}
function hideError()
{
document.getElementById('idError').style.visibility = "hidden";
document.getElementById('idAuthError').style.visibility = "hidden";
}
</script>
<style>
.required
{
align:right;
color:red;
visibility:hidden;
border:hidden;
cursor:default;
vertical-align: top;
line-height: 20px;
padding-bottom: 15px;
}
</style>
</head>
<body>
<section class="box-content-rewards">
<div style="width:550px;">
<cfoutput>
<h1 class="title-baker">
Reset TAPS
</h1>
<!--- Check if there is a saved configuration --->
<cfinvoke component="components.database" method="getSettings" returnVariable="settings">
<cfif #settings.recordCount# GT 0>
This will erase all data stored on TAPS system.<br>
This operation is similar to a factory reset.<br>
<br>
<div style="text-align: justify;text-justify: inter-word;">CAUTION: IF YOU HAVE CONFIGURED A NATIVE WALLET ON TAPS, YOU WILL
LOOSE ACCESS TO IT AFTER RESET. BE SURE TO HAVE THE PASSPHRASE AND MNEMONICS
WRITTEN DOWN IN A PIECE OF PAPER WITH YOU, OTHERWISE WALLET FUNDS WILL BE LOST.
AND THERE IS NO WAY TO RECOVER IT.</div>
<br>
To proceed, type your password twice and hit RESET button.<br>
After that, system will log out and user/password will be restored to defaults.<br>
<br>
<cfform name="form" method="post" action="reset.cfm">
<table>
<tr>
<td>
<label>
<span class="text-input-taps">Password</span>
<input type="password" id="idPassdw" name="passdw" class="input-taps" size="50" placeholder="Type your password" value="" />
</label>
</td>
</tr>
<tr>
<td>
<label>
<span class="text-input-taps">Repeat Password</span>
<input type="password" id="idPassdw2" name="passdw2" class="input-taps" size="50" placeholder="Repeat your password" value="" />
</label>
</td>
</tr>
<tr><td><input type="text" class="required" id="idError" size="50" value="Passwords are mandatory and must be equal" readonly style="visibility:hidden;"></td></tr>
<cfif #reset# EQ "yes" and #resultReset# EQ false>
<tr><td><input type="text" class="required" id="idAuthError" size="50" value="Wrong password" readonly style="visibility:visible;"></td></tr>
<cfelse>
<tr><td><input type="text" class="required" id="idAuthError" size="50" value="Wrong password" readonly style="visibility:hidden;"></td></tr>
</cfif>
<tr>
<td align="left">
<button type="button" class="botao-taps" onClick="if (validate()) { hideError(); document.form.reset.value='yes';document.form.submit(); } else { hideError(); showError(); }">RESET</button>
</td>
<cfinput name="reset" id="reset" type="hidden" value="no">
</tr>
</table>
</cfform>
<cfelseif #resultReset# EQ false>
<br>
There is no configuration saved on settings.<br>
Please go to SETUP first.<br>
<cfelseif #resultReset# EQ true>
<cfset reset="no">
<script language="javascript">
var a = document.createElement('a');
a.href='logout.cfm';
a.target = '_parent';
document.body.appendChild(a);
a.click();
</script>
</cfif>
</cfoutput>
</div>
</section>
</body>
</html>