2026-08-24 18:21:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
<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"] }}" />
|
2026-08-24 21:49:17 +02:00
|
|
|
<input type="hidden" name="is_admin" value="{% if user["is_admin"] %}false{% else %}true{% endif %}" />
|
|
|
|
|
<input type="checkbox" disabled {% if user["is_admin"] %}checked{% endif %} />
|
|
|
|
|
<button type="submit">toggle admin</button>
|
2026-08-24 18:21:20 +02:00
|
|
|
</form></td>
|
|
|
|
|
<td><form method="POST" action="/update-user">
|
|
|
|
|
<input type="hidden" name="userid" value="{{ user["userid"] }}" />
|
2026-08-24 21:49:17 +02:00
|
|
|
<input type="email" name="email" placeholder="email" value="{{ user["email"] }}"/>
|
2026-08-24 18:21:20 +02:00
|
|
|
<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>
|