add admin user list

This commit is contained in:
2026-08-24 18:21:20 +02:00
parent abdfcde1c9
commit b17b75e043
4 changed files with 95 additions and 5 deletions
+48
View File
@@ -0,0 +1,48 @@
<h2>Administration</h2>
<p>Users:
<table>
<tr><th>Username</th><th>Domains</th><th>Password</th><th>Admin</th><th>Email</th><th>Delete</th></tr>
<form method="POST" action="/create-user"><tr>
<td><input type="text" name="username" placeholder="*user name" required /></td>
<td><input type="text" name="domains" placeholder="space separated domains" /></td>
<td><input type="password" name="password" placeholder="*password" required /></td>
<td><input type="checkbox" name="is_admin" /></td>
<td><input type="email" name="email" placeholder="email" /></td>
<td><button type="submit">Add</button></td>
</tr></form>
{% for user in users %}
<tr>
<td>{{ user["username"] }}</td>
<td><form method="POST" action="/update-user">
<input type="hidden" name="userid" value="{{ user["userid"] }}" />
<input type="text" name="domains" placeholder="space separated domains" value="{{ user["domains"] | join(' ') }}" />
<button type="submit">update domains</button>
</form></td>
<td><form method="POST" action="/update-user">
<input type="hidden" name="userid" value="{{ user["userid"] }}" />
<input type="password" name="password" placeholder="*password" required />
<button type="submit">update password</button>
</form></td>
<td><form method="POST" action="/update-user">
<input type="hidden" name="userid" value="{{ user["userid"] }}" />
<input type="checkbox" name="is_admin" value="true" {% if user["is_admin"] %}checked{% endif %} />
<button type="submit">update admin</button>
</form></td>
<td><form method="POST" action="/update-user">
<input type="hidden" name="userid" value="{{ user["userid"] }}" />
<input type="email" name="email" placeholder="email" />
<button type="submit">update email</button>
</form></td>
<td><form method="POST" action="/delete-user">
<input type="hidden" name="userid" value="{{ user["userid"] }}" />
<button type="submit">Delete</button>
</form></td>
</tr>
{% endfor %}
</table>
</p>
+1 -1
View File
@@ -44,6 +44,6 @@
<input type="password" name="pass-rep" placeholder="repeat password" /><br />
<button type="submit">change password</button>
</form>
</p>
</p>{% if is_admin %}{% include 'admin.html' %}{% endif %}
</body>
</html>