diff --git a/helpdesk/settings.py b/helpdesk/settings.py index b0c9d825..7cd1765b 100644 --- a/helpdesk/settings.py +++ b/helpdesk/settings.py @@ -55,6 +55,9 @@ HELPDESK_TRANSLATE_TICKET_COMMENTS = getattr(settings, 'HELPDESK_TRANSLATE_TICKE # list of languages to offer. if set to false, all default google translate languages will be shown. HELPDESK_TRANSLATE_TICKET_COMMENTS_LANG = getattr(settings, 'HELPDESK_TRANSLATE_TICKET_COMMENTS_LANG', ["en", "de", "fr", "ru"]) +# show link to 'change password' on 'User Settings' page? +HELPDESK_SHOW_CHANGE_PASSWORD = getattr(settings, 'HELPDESK_SHOW_CHANGE_PASSWORD', False) + # allow user to override default layout for 'followups' - work in progress. HELPDESK_FOLLOWUP_MOD = getattr(settings, 'HELPDESK_FOLLOWUP_MOD', False) diff --git a/helpdesk/templates/helpdesk/user_settings.html b/helpdesk/templates/helpdesk/user_settings.html index 45cd659a..19cf72c4 100644 --- a/helpdesk/templates/helpdesk/user_settings.html +++ b/helpdesk/templates/helpdesk/user_settings.html @@ -2,10 +2,20 @@ {% block helpdesk_title %}{% trans "Change User Settings" %}{% endblock %} -{% block helpdesk_body %}{% blocktrans %} +{% block helpdesk_body %} +{% if show_password_change_link %} +{% url auth_password_change as password_change_url %} +

Change Password

+

+Change your password here. +

+{% endif %} + +{% blocktrans %}

User Settings

-

Use the following options to change the way your helpdesk system works for you. These settings do not impact any other user.

{% endblocktrans %} +

Use the following options to change the way your helpdesk system works for you. These settings do not impact any other user.

+{% endblocktrans %}
diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py index 44e9722c..17af2ad2 100644 --- a/helpdesk/views/staff.py +++ b/helpdesk/views/staff.py @@ -1004,9 +1004,16 @@ def user_settings(request): else: form = UserSettingsForm(s.settings) + user = User.objects.get(id = request.user.id) + show_password_change_link = 0 + # we don't want non-local users to see the 'change password' link. + if helpdesk_settings.HELPDESK_SHOW_CHANGE_PASSWORD and user.has_usable_password(): + show_password_change_link = 1 + return render_to_response('helpdesk/user_settings.html', RequestContext(request, { 'form': form, + 'show_password_change_link': show_password_change_link, })) user_settings = staff_member_required(user_settings)