]> code.octet-stream.net Git - broadcaster/blob - server/templates/user.html
Clear up logged out and old sessions
[broadcaster] / server / templates / user.html
1
2 <h2>
3 {{if .User.Id}}
4 Edit User
5 {{else}}
6 Add New User
7 {{end}}
8 </h2>
9 <form action="/users/submit" method="POST">
10 <input type="hidden" name="userId" value="{{.User.Id}}">
11 <p>
12 <label for="username">Username:</label>
13 <input type="text" id="username" name="username" value="{{.User.Username}}" {{if .User.Id}} disabled {{end}}>
14 </p>
15 <p>
16 <input type="checkbox" id="isAdmin" name="isAdmin" value="1" {{if .User.IsAdmin}} checked {{end}}>
17 <label for="isAdmin">Is an administrator - can manage system users</label><br>
18 </p>
19 {{if not .User.Id}}
20 <p>
21 <label for="password">Password:</label>
22 <input type="password" id="password" name="password">
23 </p>
24 {{end}}
25 <p>
26 <input type="submit" value="Save User">
27 </p>
28 </form>
29 {{if .User.Id}}
30 <h3>Reset Password</h3>
31 <form action="/users/reset-password" method="POST">
32 <input type="hidden" name="userId" value="{{.User.Id}}">
33 <p>
34 <label for="newPassword">New Password:</label>
35 <input type="password" id="newPassword" name="newPassword">
36 </p>
37 <p>
38 <input type="submit" value="Reset Password">
39 </p>
40 </form>
41 <h3>Delete</h3>
42 <form action="/users/delete" method="POST">
43 <input type="hidden" name="userId" value="{{.User.Id}}">
44 <p>
45 <input type="submit" value="Delete User">
46 </p>
47 </form>
48 {{end}}