FreedomBox/plinth/modules/users/templates/users_firstboot.html
Sunil Mohan Adapa 1dcbfce713
users: Use privileged decorator for actions
Tests:

- Functional tests work (failing already)
- DONE: Showing front page shortcuts according to user groups works
  - DONE: Only user who is party of syncthing group is shown syncthing
  - DONE: Admin users are always shown all the apps
- DONE: Syncthing:
  - Not tested: When upgrading from version 2 or below, renaming group works
  - DONE: Syncthing is added to freedombox-share group
- DONE: Initial setup of users app works
  - DONE: freedombox-share group is created
- DONE: Retriving last admin user works
  - DONE: Last admin is not allowed to delete account
- DONE: Creating a new user works
  - DONE: Password is set properly (user can login with 'su - user' after)
  - DONE: Incorrect confirmation password leads to error
  - DONE: Adding the user to groups works (edit page shows correct list of groups)
- DONE: Editing a user works
  - DONE: User is renamed properly
  - DONE: Removing user from groups works
  - DONE: Adding user to new groups works
  - DONE: Providing incorrect auth password results in error message
  - DONE: Enabling/disabling account work (confirm with 'su - user'). See #2277.
- DONE: Updating user password works
  - DONE: New password is set (confirm with 'su - user')
  - DONE: Providing incorrect auth password results in error message
- DONE: Initial user account creation works
  - DONE: User account can be used (confirm with 'su - user')
  - DONE: User is added to admin group
- DONE: Exception while getting SSH keys results in showing empty field
- DONE: Removing a user works
  - DONE: Command provided in a message in users_firstboot.html works for
    deleting users.
- DONE: If an admin users exists when running first wizard, list of admin users
  is shown.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:53:52 -04:00

67 lines
1.8 KiB
HTML

{% extends "base_firstboot.html" %}
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load bootstrap %}
{% load i18n %}
{% load static %}
{% block content %}
<h2>{% trans "Administrator Account" %}</h2>
{% if not admin_users %}
<p>
{% blocktrans trimmed %}
Choose a username and password to access this web interface.
The password can be changed later. This user will be granted
administrative privileges. Other users can be added later.
{% endblocktrans %}
</p>
<form class="form form-create" method="post">
{% csrf_token %}
{{ form|bootstrap }}
<input type="submit" class="btn btn-primary"
value="{% trans "Create Account" %}"/>
</form>
{% else %}
<div class="alert alert-danger" role="alert">
{% blocktrans trimmed %}
An administrator account already exists.
{% endblocktrans %}
</div>
<p>
{% blocktrans trimmed %}
The following administrator accounts exist in the system.
{% endblocktrans %}
</p>
<ul>
{% for user in admin_users %}
<li>{{ user }} </li>
{% endfor %}
</ul>
<p>
{% blocktrans trimmed %}
Delete these accounts from command line and refresh the page to create
an account that is usable with {{ box_name }}. On the command line run
the command "echo '{"args": ["USERNAME", "PASSWORD"], "kwargs": {}}' |
sudo /usr/share/plinth/actions/actions users remove_user". If an
account is already usable with {{ box_name }}, skip this step.
{% endblocktrans %}
</p>
<form class="form form-skip" method="post">
{% csrf_token %}
<input type="submit" class="btn btn-link" name="skip"
value="{% trans "Skip this step" %}"/>
</form>
{% endif %}
{% endblock %}