Add option to edit users from the comfort of the UI

Update user management feature to allow editing user details directly in the admin user interface.

Also added an option to reset the two factor authentication data of a user, for when that's needed (lost device, technical issues etc).

(cherry picked from commit 3139616282a18c11463c6ecf78888417b2ac1c35)
This commit is contained in:
Thomas M Steenholdt
2018-08-12 07:40:32 -02:00
parent 85e745731b
commit 0ac33aa3c4
4 changed files with 143 additions and 22 deletions

View File

@ -20,7 +20,7 @@
<h3 class="box-title">User Management</h3>
</div>
<div class="box-body">
<a href="{{ url_for('admin_createuser') }}">
<a href="{{ url_for('admin_edituser') }}">
<button type="button" class="btn btn-flat btn-primary pull-left button_add_user">
Add User&nbsp;<i class="fa fa-plus"></i>
</button>
@ -36,7 +36,7 @@
<th>Email</th>
<th>Admin</th>
<th>Privileges</th>
<th>Deletion</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@ -54,7 +54,10 @@
Revoke&nbsp;<i class="fa fa-lock"></i>
</button>
</td>
<td width="6%">
<td width="15%">
<button type="button" class="btn btn-flat btn-success button_edit" onclick="window.location.href='{{ url_for('admin_edituser', user_username=user.username) }}'">
Edit&nbsp;<i class="fa fa-lock"></i>
</button>
<button type="button" class="btn btn-flat btn-danger button_delete" id="{{ user.username }}" {% if user.username==current_user.username %}disabled{% endif %}>
Delete&nbsp;<i class="fa fa-trash"></i>
</button>