136 lines
4.2 KiB
HTML
136 lines
4.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>Buckler</title>
|
|
<link rel="stylesheet" type="text/css" href="/static/buckler.css">
|
|
<script>
|
|
var users_perms = {{ users_json|safe }};
|
|
</script>
|
|
<script type="text/javascript" src="/static/buckler.js"></script>
|
|
<script>window.onload = load;</script>
|
|
<meta name="viewport" content="width=device-width, initial-scale=0.8">
|
|
<meta name="description" content="A small shield for web applications.">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<object id="logo" title="Buckler logo" data="/static/buckler_icon.svg"></object>
|
|
<h1>Buckler</h1>
|
|
</header>
|
|
<main>
|
|
<section>
|
|
<h2>Available Sites</h2>
|
|
<article>
|
|
<hr>
|
|
<ul id="avail_sites">
|
|
{% for site in avail_sites %}
|
|
<li><a href="{{ site['url'] }}">{{ site['name'] }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
</article>
|
|
</section>
|
|
{% if request['session']['admin'] %}
|
|
<section>
|
|
<h2>User Permissions</h2>
|
|
<article style="display: none;">
|
|
<hr>
|
|
<table id="users">
|
|
<thead>
|
|
<tr>
|
|
<th>User</th>
|
|
{% for app in apps %}
|
|
<th>{{ app['name'] }}</th>
|
|
{% endfor %}
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for username, values in users.items() %}
|
|
<tr>
|
|
<td>{{ username }}</td>
|
|
{% for name, value in values.items() %}
|
|
<td><input aria-label="{{ username }}-{{ name }}" data-app-name={{ name }} type="checkbox" onchange="perm_change(this.parentElement.parentElement)"{% if value %} checked{% endif %}></td>
|
|
{% endfor %}
|
|
<td><input type="submit"></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</article>
|
|
</section>
|
|
{% endif %}
|
|
<section>
|
|
<h2>Change Password</h2>
|
|
<article style="display: none;">
|
|
<hr>
|
|
<form action="{{ request.app.router['change_password'].url_for() }}" method="post" enctype="application/x-www-form-urlencoded">
|
|
<label for="current_password">Current password</label>
|
|
<input id="current_password" name="current_password" type="password"><br>
|
|
<label for="new_password">New password</label>
|
|
<input id="new_password" name="new_password" type="password"><br>
|
|
<label for="verify_password">Verify password</label>
|
|
<input id="verify_password" name="verify_password" type="password"><br>
|
|
<input type="submit" value="Submit">
|
|
</form>
|
|
</article>
|
|
</section>
|
|
<section>
|
|
<h2>Security Keys</h2>
|
|
<article style="display: none;">
|
|
<hr>
|
|
{% if fido2_keys %}
|
|
<form action="{{ request.app.router['delete_key'].url_for() }}" method="POST" enctype="application/x-www-form-urlencoded">
|
|
<table id="security_keys">
|
|
<thead>
|
|
<tr>
|
|
<th>Nick</th>
|
|
<th>Delete</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for key in fido2_keys %}
|
|
<tr>
|
|
<td>{{ key['nick'] }}</td>
|
|
<td><input aria-label="Delete {{ key['nick'] }}" id="fido-{{ key['id'] }}" name="fido-{{ key['id'] }}" type="checkbox"></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
<input type="submit" value="Delete">
|
|
</form>
|
|
{% else %}
|
|
<span>No registered keys.</span>
|
|
{% endif %}
|
|
<br><a href="./add_key">Add key</a>
|
|
</article>
|
|
</section>
|
|
<section>
|
|
<h2>Active Sessions</h2>
|
|
<article style="display: none;">
|
|
<hr>
|
|
<form action="{{ request.app.router['delete_session'].url_for() }}" method="POST" enctype="application/x-www-form-urlencoded">
|
|
<table id="active_sessions">
|
|
<thead>
|
|
<tr>
|
|
<th>Session ID</th>
|
|
<th>IP Address</th>
|
|
<th>Delete</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for session in active_sessions %}
|
|
<tr>
|
|
<td><code>{{ session['id'][:5] }}...{{ session['id'][-5:] }}</code></td>
|
|
<td>{{ session['ip_address'] }}</td>
|
|
<td><input aria-label="Delete {{ session['id'][:5] }}...{{ session['id'][-5:] }}" id="session-{{ session['id'] }}" name="session-{{ session['id'] }}" type="checkbox"></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
<input type="submit" value="Delete">
|
|
</form>
|
|
</article>
|
|
</section>
|
|
</main>
|
|
</body>
|
|
</html>
|