From e6d45b6d6028527079744af20dc9407a2a3867f2 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 25 Aug 2015 13:40:13 +0800 Subject: Bug 1196134 - add ability for admins to force a user to change their password on next login --- template/en/default/admin/users/edit.html.tmpl | 12 +++++++ template/en/default/admin/users/userdata.html.tmpl | 37 +++++++++++++++------- 2 files changed, 37 insertions(+), 12 deletions(-) (limited to 'template/en/default/admin/users') diff --git a/template/en/default/admin/users/edit.html.tmpl b/template/en/default/admin/users/edit.html.tmpl index a5ab5cf03..fbf283574 100644 --- a/template/en/default/admin/users/edit.html.tmpl +++ b/template/en/default/admin/users/edit.html.tmpl @@ -38,6 +38,18 @@ $(function() { } }) .keyup(); + + $('#password_change_required') + .change(function() { + $('#password').prop('disabled', $(this).is(':checked')); + if ($(this).is(':checked')) { + $('#password_change_reason_container').show(); + } + else { + $('#password_change_reason_container').hide(); + } + }) + .change(); }); [% END %] diff --git a/template/en/default/admin/users/userdata.html.tmpl b/template/en/default/admin/users/userdata.html.tmpl index 63f69cfe9..ebe7451e4 100644 --- a/template/en/default/admin/users/userdata.html.tmpl +++ b/template/en/default/admin/users/userdata.html.tmpl @@ -64,24 +64,37 @@ -[%# XXX This condition (can_change_password) will cause a problem - # if we ever have a login system that can create accounts through - # createaccount.cgi but can't change passwords. - #%] - [% IF editusers %] - [% IF user.authorizer.can_change_password %] - + + + - - [% IF editform %]
- (Enter new password to change.) + + [%# if a user's cryptpassword is '*' it means they use an auth provider + # such as github, or you can't log in with that account. in either case + # forcing a password reset isn't valid %] + [% IF otheruser.cryptpassword != '*' && editform %] +
+ + +
+ Password change reason (will be displayed to the user):
+ +
[% END %] - [% END %] + -- cgit v1.2.3-24-g4f1b