Allow root to reset user password

This commit is contained in:
Skia
2016-08-13 17:15:45 +02:00
parent a033c4dfd2
commit 792563999b
7 changed files with 265 additions and 195 deletions

View File

@ -2,7 +2,10 @@
{% block content %}
<form method="post" action="{{ url('core:password_change') }}">
{% if target %}
<p>{% trans user=target.get_display_name() %}Change password for {{ user }}{% endtrans %}</p>
{% endif %}
<form method="post" action="">
{% csrf_token %}
{{ form.as_p() }}
<input type="submit" value="{% trans %}Change{% endtrans %}" />

View File

@ -28,6 +28,8 @@
{% endif %}
{% if form.instance == user %}
<p><a href="{{ url('core:password_change') }}">{% trans %}Change my password{% endtrans %}</a></p>
{% elif user.is_root() %}
<p><a href="{{ url('core:password_root_change', user_id=form.instance.id) }}">{% trans %}Change user password{% endtrans %}</a></p>
{% endif %}
</form>
{% endblock %}