mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
users: Deal with admin user already existing during first boot
- Trying to create another admin user using the first boot wizard will certainly fail. - Show the list of admin users in the system so that they an be deleted and creation of admin by first boot wizard can continue. - If existing account can already work (such as when Plinth and LDAP entries exist) allow skipping the step. - Since the scenario is mostly like encountered only during advanced usage and not for most regular users, the technical nature of solutions is okay. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
2 files changed
+69
-14
No files matched your search
@@ -10,21 +10,57 @@
|
||||
{% block content %}
|
||||
<h2>{% trans "Administrator Account" %}</h2>
|
||||
|
||||
<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>
|
||||
{% 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" method="post">
|
||||
{% csrf_token %}
|
||||
<form class="form" method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
{{ form|bootstrap }}
|
||||
{{ form|bootstrap }}
|
||||
|
||||
<input type="submit" class="btn btn-primary"
|
||||
value="{% trans "Create Account" %}"/>
|
||||
</form>
|
||||
<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 "{password}" | /usr/share/plinth/actions/users
|
||||
remove-user {username}'. If an account is already usable with
|
||||
{{ box_name }}, skip this step.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
|
||||
<form class="form" method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
<input type="submit" class="btn btn-link" name="skip"
|
||||
value="{% trans "Skip this step" %}"/>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in new issue
Block a user