Bugzilla – Attachment 164506 Details for
Bug 33832
Can't change a patron's username without entering passwords
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33832: Allow updating username without changing password on member-password.pl
Bug-33832-Allow-updating-username-without-changing.patch (text/plain), 2.68 KB, created by
Brendan Lawlor
on 2024-04-08 14:14:10 UTC
(
hide
)
Description:
Bug 33832: Allow updating username without changing password on member-password.pl
Filename:
MIME Type:
Creator:
Brendan Lawlor
Created:
2024-04-08 14:14:10 UTC
Size:
2.68 KB
patch
obsolete
>From 698f18745aa6f9f08c24be02c255789df4a8eaef Mon Sep 17 00:00:00 2001 >From: Brendan Lawlor <blawlor@clamsnet.org> >Date: Mon, 8 Apr 2024 14:00:21 +0000 >Subject: [PATCH] Bug 33832: Allow updating username without changing password > on member-password.pl > >This patch updates the change password page on the staff interface to allow for changing the patron's username without changing the password. If the new password is an empty string we can skip setting the patron's password and sending the new password to the template. >--- > .../prog/en/modules/members/member-password.tt | 4 +++- > members/member-password.pl | 8 +++++--- > 2 files changed, 8 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt >index 418bd7eadd..3d52a7f7e0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt >@@ -193,7 +193,9 @@ > }); > }); > </script> >- [% PROCESS 'password_check.inc' new_password => 'newpassword', minPasswordLength => patron.category.effective_min_password_length, RequireStrongPassword => patron.category.effective_require_strong_password %] >+ [% IF new_password.defined %] >+ [% PROCESS 'password_check.inc' new_password => 'newpassword', minPasswordLength => patron.category.effective_min_password_length, RequireStrongPassword => patron.category.effective_require_strong_password %] >+ [% END %] > [% END %] > > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/members/member-password.pl b/members/member-password.pl >index e2c56f0686..0ddef521ea 100755 >--- a/members/member-password.pl >+++ b/members/member-password.pl >@@ -55,13 +55,15 @@ if ( ( $patron_id ne $loggedinuser ) && ( $category_type eq 'S' ) ) { > > push( @errors, 'NOMATCH' ) if ( ( $newpassword && $newpassword2 ) && ( $newpassword ne $newpassword2 ) ); > >-if ( $op eq 'cud-update' && $newpassword and not @errors ) { >+if ( $op eq 'cud-update' && $newpassword.defined and not @errors ) { > > try { >- $patron->set_password({ password => $newpassword }); >+ if ( $newpassword ne '' ) { >+ $patron->set_password({ password => $newpassword }); >+ $template->param( newpassword => $newpassword ); >+ } > $patron->userid($new_user_id)->store > if $new_user_id and $new_user_id ne $patron->userid; >- $template->param( newpassword => $newpassword ); > if ( $destination eq 'circ' ) { > print $input->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=" . $patron->cardnumber); > } >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33832
:
164506
|
164507
|
164522
|
164856
|
164858
|
164987