-
Notifications
You must be signed in to change notification settings - Fork 248
Expand file tree
/
Copy pathaccount.template.html
More file actions
executable file
·166 lines (166 loc) · 6.51 KB
/
account.template.html
File metadata and controls
executable file
·166 lines (166 loc) · 6.51 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
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
{%TEMPLATE->struct/head%}
{%TEMPLATE->struct/menu%}
<h2>My Account ([[htmlentities([[user.getUsername()]], ENT_QUOTES, "UTF-8")]])</h2>
{%TEMPLATE->struct/messages%}
<div class="card">
<div class="table-responsive">
<table class="table table-bordered">
<tr>
<th>User type</th>
<td>
[[group.getGroupName()]]
</td>
</tr>
<tr>
<th>Register date</th>
<td>
[[date([[config.getVal(DConfig::TIME_FORMAT)]], [[user.getRegisteredSince()]])]]
</td>
</tr>
<tr>
<th>Email address</th>
<td>
<form class='form-inline' action="account.php" method="post">
<input type='hidden' name='action' value='[[$DAccountAction::SET_EMAIL]]'>
<input type='email' name='email' class='form-control' value='[[user.getEmail()]]' title="Email">
<input type="hidden" name="csrf" value="[[csrf]]">
<button type="submit" class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}}' data-toggle="tooltip" data-placement="top" title="Set"><i class="fas fa-save" aria-hidden="true"></i></button>
</form>
</td>
</tr>
<tr>
<th>Set session length</th>
<td>
<form class='form-inline' action="account.php" method="post">
<input type='hidden' name='action' value='[[$DAccountAction::UPDATE_LIFETIME]]'>
<input type='text' name='lifetime' class='form-control' value='[[user.getSessionLifetime()]]' title="Session Length"> seconds
<input type="hidden" name="csrf" value="[[csrf]]">
<button type="submit" class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}}' data-toggle="tooltip" data-placement="top" title="Set"><i class="fas fa-save" aria-hidden="true"></i></button>
</form>
</td>
</tr>
{{IF [[user.getIsLDAP()]] == 0}}
<tr>
<th>Password</th>
<td>
<form class='form-inline' action="account.php" method="post">
<input type='hidden' name='action' value='[[$DAccountAction::CHANGE_PASSWORD]]'>
<input type='password' name='oldpass' class='form-control' placeholder='Old password here...'>
<input type='password' name='newpass' class='form-control' placeholder='New password here...'>
<input type='password' name='reppass' class='form-control' placeholder='Repeat password...'>
<input type="hidden" name="csrf" value="[[csrf]]">
<input type="submit" class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}}' value="Change Password">
</form>
</td>
</tr>
{{ENDIF}}
</table>
</div>
</div>
<div class="card">
<div class="table-responsive">
<table class="table table-bordered">
<tr>
<td colspan="2">
<div class="alert alert-warning">
<b>Disclaimer:</b> Administrators cannot reset your OTP auth information if your key is lost.
</div>
</td>
</tr>
{{IF ![[Util::isYubikeyEnabled()]]}}
<tr>
<th>Yubikey OTP</th>
<td>
Yubikey is currently not configured.<br>
Please contact an admin as it needs to be enabled and set up on the server configuration.
</td>
</tr>
{{ELSE}}
<tr>
<th>Enable/Disable Yubikey OTP</th>
<td>
{{IF [[user.getYubikey()]] == 1}}
<form class='form-inline' action="account.php" method="post">
Yubikey OTP currently enabled
<input type='hidden' name='action' value='[[$DAccountAction::YUBKEY_DISABLE]]'>
<input type="hidden" name="csrf" value="[[csrf]]">
<input type="submit" class='btn btn-warning' value="Disable">
</form>
{{ELSE}}
<form class='form-inline' action="account.php" method="post">
Yubikey OTP is currently disabled
<input type='hidden' name='action' value='[[$DAccountAction::YUBKEY_ENABLE]]'>
<input type="hidden" name="csrf" value="[[csrf]]">
<input type="submit" class='btn btn-success' value="Enable">
</form>
{{ENDIF}}
</td>
</tr>
<tr>
<th>OTP KEY 1:</th>
<td>
<form class='form-inline' action="account.php" method="post">
<input type='hidden' name='action' value='[[$DAccountAction::SET_OTP1]]'>
<input type='text' name='otp1' class='form-control' value='[[user.getOtp1()]]' title="OTP Key">
<input type="hidden" name="csrf" value="[[csrf]]">
<input type="submit" class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}}' value="Update">
</form>
</td>
</tr>
<tr>
<th>OTP KEY 2:</th>
<td>
<form class='form-inline' action="account.php" method="post">
<input type='hidden' name='action' value='[[$DAccountAction::SET_OTP2]]'>
<input type='text' name='otp2' class='form-control' value='[[user.getOtp2()]]' title="OTP Key">
<input type="hidden" name="csrf" value="[[csrf]]">
<input type="submit" class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}}' value="Update">
</form>
</td>
</tr>
<tr>
<th>OTP KEY 3:</th>
<td>
<form class='form-inline' action="account.php" method="post">
<input type='hidden' name='action' value='[[$DAccountAction::SET_OTP3]]'>
<input type='text' name='otp3' class='form-control' value='[[user.getOtp3()]]' title="OTP Key">
<input type="hidden" name="csrf" value="[[csrf]]">
<input type="submit" class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}}' value="Update">
</form>
</td>
</tr>
<tr>
<th>OTP KEY 4:</th>
<td>
<form class='form-inline' action="account.php" method="post">
<input type='hidden' name='action' value='[[$DAccountAction::SET_OTP4]]'>
<input type='text' name='otp4' class='form-control' value='[[user.getOtp4()]]' title="OTP Key">
<input type="hidden" name="csrf" value="[[csrf]]">
<input type="submit" class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}}' value="Update">
</form>
</td>
</tr>
{{ENDIF}}
</table>
</div>
</div>
{{IF [[sizeof([[keys]])]] > 0}}
<h3>API Access</h3>
<div class="card">
<div class="table-responsive">
<table class="table table-bordered">
<tbody>
<tr>
<th>Keys</th>
<td>
{{FOREACH key;[[keys]]}}
[[key.getAccessKey()]]<br>
{{ENDFOREACH}}
</td>
</tr>
</tbody>
</table>
</div>
</div>
{{ENDIF}}
{%TEMPLATE->struct/foot%}