91 lines
5.1 KiB
HTML
91 lines
5.1 KiB
HTML
{% extends "base.html" %}
|
||
{% block title %}{{ target.display_name }} · {{ appearance.name }}{% endblock %}
|
||
|
||
{% block content %}
|
||
<p><a href="/admin/users">← {{ _('All users') }}</a></p>
|
||
<section class="card narrow">
|
||
<h1>{{ target.display_name }}</h1>
|
||
<p class="readonly">{{ target.email }}</p>
|
||
{% if error %}<p class="alert error" role="alert">{{ _(error) }}</p>{% endif %}
|
||
{% if target.is_locked %}
|
||
<div class="alert warn" role="status">
|
||
<p><strong>{{ _('Temporarily locked') }}</strong></p>
|
||
<p>{{ _('Reason: %(num)d failed sign-in attempts in a row.', num=lock_attempts) }}
|
||
{{ _('Locked since %(since)s, until %(until)s. Until then, sign-in fails even with the right password.', since=lock_since | datetime, until=target.locked_until | datetime) }}</p>
|
||
<form method="post" action="/admin/users/{{ target.public_id }}/unlock">
|
||
{{ csrf_field(request) }}<button type="submit" class="secondary">{{ _('Lift lock') }}</button>
|
||
</form>
|
||
<p class="hint">{{ _('If the attempts did not come from this person, reset the password instead and check the log.') }}</p>
|
||
</div>
|
||
{% endif %}
|
||
<form method="post" action="/admin/users/{{ target.public_id }}" class="form">
|
||
{{ csrf_field(request) }}
|
||
<label for="display_name">{{ _('Name') }}</label>
|
||
<input id="display_name" name="display_name" type="text" required maxlength="120" value="{{ target.display_name }}">
|
||
<label for="role">{{ _('Role') }}</label>
|
||
<select id="role" name="role">
|
||
{% for value, label in role_names.items() %}
|
||
<option value="{{ value }}" {% if target.role == value %}selected{% endif %}>{{ _(label) }}</option>
|
||
{% endfor %}
|
||
</select>
|
||
<label class="check"><input type="checkbox" name="is_active" {% if target.is_active %}checked{% endif %}> {{ _('Account is active') }}</label>
|
||
<button type="submit">{{ _('Save') }}</button>
|
||
</form>
|
||
<dl class="status">
|
||
<dt>{{ _('Created') }}</dt><dd>{{ target.created_at | datetime }}</dd>
|
||
<dt>{{ _('Last sign-in') }}</dt><dd>{{ target.last_login_at | datetime }}</dd>
|
||
<dt>{{ _('Status') }}</dt>
|
||
<dd>{% if not target.is_active %}{{ _('deactivated') }}{% elif target.is_locked %}{{ _('temporarily locked') }}{% elif not target.password_hash %}{{ _('invited') }}{% else %}{{ _('active') }}{% endif %}{% if target.failed_logins and not target.is_locked %} · {{ ngettext('%(num)d failed sign-in attempt since the last success', '%(num)d failed sign-in attempts since the last success', target.failed_logins) }}{% endif %}</dd>
|
||
<dt>{{ _('Two-factor authentication') }}</dt>
|
||
<dd>
|
||
{% if target.has_totp %}{{ _('Authenticator app') }}{% endif %}
|
||
{% if target.has_passkey %}{{ ngettext('%(num)d passkey', '%(num)d passkeys', target.passkeys | length) }}{% endif %}
|
||
{% if not target.has_second_factor %}{{ _('off') }}{% endif %}
|
||
</dd>
|
||
<dt>{{ _('Groups') }}</dt>
|
||
<dd>{% for g in groups %}{{ g.name }}{% if not loop.last %}, {% endif %}{% else %}–{% endfor %}</dd>
|
||
</dl>
|
||
</section>
|
||
|
||
<section class="card narrow">
|
||
<h2>{% if target.password_hash %}{{ _('Reset sign-in') }}{% else %}{{ _('Invitation link') }}{% endif %}</h2>
|
||
<p>
|
||
{% if target.password_hash %}
|
||
{{ _('Creates a one-time link with which the person sets a new password. Valid for 24 hours.') }}
|
||
{% else %}
|
||
{{ _('Creates a new invitation link. Valid for 7 days; earlier links become invalid.') }}
|
||
{% endif %}
|
||
</p>
|
||
<form method="post" action="/admin/users/{{ target.public_id }}/link" class="form">
|
||
{{ csrf_field(request) }}
|
||
{% if target.has_second_factor %}
|
||
<label class="check"><input type="checkbox" name="reset_2fa"> {{ _('Also remove all second factors: authenticator app and passkeys (for example if the device was lost)') }}</label>
|
||
{% endif %}
|
||
<div class="inline-actions">
|
||
<button type="submit" class="secondary" name="send_mail" value="on">{{ _('Send link by email') }}</button>
|
||
<button type="submit" class="secondary">{{ _('Create link and show it') }}</button>
|
||
</div>
|
||
<p class="hint">{{ _('By email, the link goes to %(address)s and is not shown here.', address=target.email) }}</p>
|
||
</form>
|
||
<form method="post" action="/admin/users/{{ target.public_id }}/sessions">
|
||
{{ csrf_field(request) }}
|
||
<button type="submit" class="secondary">{{ _('Sign out all sessions of this user') }}</button>
|
||
</form>
|
||
</section>
|
||
<section class="card narrow">
|
||
<h2>{{ _('Data of this user') }}</h2>
|
||
<p>{{ _('For a request for access: everything stored about this person, as a JSON file. The export is recorded in the log.') }}</p>
|
||
<form method="post" action="/admin/users/{{ target.public_id }}/export">
|
||
{{ csrf_field(request) }}
|
||
<button type="submit" class="secondary">{{ _('Export data') }}</button>
|
||
</form>
|
||
</section>
|
||
{% if user and target.id != user.id %}
|
||
<section class="card narrow">
|
||
<h2>{{ _('Delete user') }}</h2>
|
||
<p>{{ _('Deletes the account with all its data. You see beforehand exactly what will be deleted and decide what happens to the forms of this user.') }}</p>
|
||
<p><a class="button danger" href="/admin/users/{{ target.public_id }}/delete">{{ _('Delete user …') }}</a></p>
|
||
</section>
|
||
{% endif %}
|
||
{% endblock %}
|