Bugzilla – Attachment 83601 Details for
Bug 22048
Use set_password instead of update_password in the codebase
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22048: Use set_password opac/opac-password-recovery.pl
Bug-22048-Use-setpassword-opacopac-password-recove.patch (text/plain), 2.02 KB, created by
Josef Moravec
on 2019-01-02 20:34:51 UTC
(
hide
)
Description:
Bug 22048: Use set_password opac/opac-password-recovery.pl
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2019-01-02 20:34:51 UTC
Size:
2.02 KB
patch
obsolete
>From d441b22fd427a26ba5995e04c15d9f8656f861a3 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 13 Dec 2018 12:56:42 -0300 >Subject: [PATCH] Bug 22048: Use set_password opac/opac-password-recovery.pl > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > opac/opac-password-recovery.pl | 21 ++++++++++++++------- > 1 file changed, 14 insertions(+), 7 deletions(-) > >diff --git a/opac/opac-password-recovery.pl b/opac/opac-password-recovery.pl >index 2b39e52..6429f7b 100755 >--- a/opac/opac-password-recovery.pl >+++ b/opac/opac-password-recovery.pl >@@ -146,19 +146,26 @@ elsif ( $query->param('passwordReset') ) { > } elsif ( $password ne $repeatPassword ) { > $error = 'errPassNotMatch'; > } else { >- my ( $is_valid, $err) = Koha::AuthUtils::is_password_valid( $password ); >- unless ( $is_valid ) { >- $error = 'password_too_short' if $err eq 'too_short'; >- $error = 'password_too_weak' if $err eq 'too_weak'; >- $error = 'password_has_whitespaces' if $err eq 'has_whitespaces'; >- } else { >- Koha::Patrons->find($borrower_number)->update_password( $username, $password ); >+ try { >+ Koha::Patrons->find($borrower_number)->set_password({ password => $password }); >+ > CompletePasswordRecovery($uniqueKey); > $template->param( > password_reset_done => 1, > username => $username > ); > } >+ catch { >+ if ( $_->isa('Koha::Exceptions::Password::TooShort') ) { >+ $error = 'password_too_short'; >+ } >+ elsif ( $_->isa('Koha::Exceptions::Password::WhitespaceCharacters') ) { >+ $error = 'password_has_whitespaces'; >+ } >+ elsif ( $_->isa('Koha::Exceptions::Password::TooWeak') ) { >+ $error = 'password_too_weak'; >+ } >+ }; > } > if ( $error ) { > $template->param( >-- >2.1.4
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 22048
:
83501
|
83502
|
83503
|
83504
|
83505
|
83506
|
83507
|
83585
|
83586
|
83587
|
83588
|
83589
|
83590
|
83591
|
83597
|
83598
|
83599
|
83600
| 83601 |
83602
|
83603