Bugzilla – Attachment 164856 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.45 KB, created by
Brendan Lawlor
on 2024-04-12 15:33:58 UTC
(
hide
)
Description:
Bug 33832: Allow updating username without changing password on member-password.pl
Filename:
MIME Type:
Creator:
Brendan Lawlor
Created:
2024-04-12 15:33:58 UTC
Size:
2.45 KB
patch
obsolete
>From d38b395c436331984e58eb8bbc03da890751ec72 Mon Sep 17 00:00:00 2001 >From: Brendan Lawlor <blawlor@clamsnet.org> >Date: Fri, 12 Apr 2024 15:29:37 +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. > >Test plan: >1. From a patron record tool bar click 'Change password' >2. Notice that if you try to change the user's name without also changing the password the page just reloads and nothing happens >3. Apply patch and restart_all >4. From the patron record click 'Change password' again >5. Set the user's new username and password eg. '1234Abc' and click 'Save' >6. Confirm that you can log in to the OPAC with the user >7. Return to the patron record and click 'Change password' again >8. This time change just the 'New username field' and click 'Save' >6. Notice that the username is updated >7. Confirm you can log into the OPAC with the new username and the original password '1234Abcd' >8. Make sure that the change password form still validates passwords for length and matching errors etc >--- > members/member-password.pl | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/members/member-password.pl b/members/member-password.pl >index e2c56f0686..085b81b4ae 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' && defined($newpassword) 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.39.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