Bugzilla – Attachment 114721 Details for
Bug 27311
Don't pass borrowernumber to check_password plugin hook
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27311 - Don't pass borrowernumber to check_password
Bug-27311---Dont-pass-borrowernumber-to-checkpassw.patch (text/plain), 2.56 KB, created by
Magnus Enger
on 2020-12-29 11:44:57 UTC
(
hide
)
Description:
Bug 27311 - Don't pass borrowernumber to check_password
Filename:
MIME Type:
Creator:
Magnus Enger
Created:
2020-12-29 11:44:57 UTC
Size:
2.56 KB
patch
obsolete
>From e6899b0139cea557d5e3f9173d515a909303571c Mon Sep 17 00:00:00 2001 >From: Magnus Enger <magnus@libriotech.no> >Date: Tue, 29 Dec 2020 12:39:19 +0100 >Subject: [PATCH] Bug 27311 - Don't pass borrowernumber to check_password > >Bug 22706 added the check_password plugin hook, taking both a >borrowernumber and the raw password as arguments. The hook is >called in two places in Koha::Patron, but because of how the code >that calls the hook is placed, passing borrowernumber to the plugin >inside "sub store" never worked. This patch removes the passing >of the borrowernumber from both calls. > >A tiny plugin that uses the check_password hooks can ve found here: >https://github.com/Libriotech/koha-plugin-pin > >To test: >- Enable plugins >- Optionally install the PIN plugin >- Add and edit users in all possible ways, including >-- Setting a password for a new user >-- Changing a password in the staff client >-- Changing a password in the OPAC >-- Creating a disabled user account > >Sign off, if all this works as expected. >--- > Koha/Patron.pm | 9 +-------- > 1 file changed, 1 insertion(+), 8 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 64e8fac486..8d55b41fd1 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -243,7 +243,6 @@ sub store { > my $ret = $plugin->check_password( > { > password => $self->password, >- borrowernumber => $self->borrowernumber > } > ); > if ( $ret->{'error'} == 1 ) { >@@ -830,18 +829,12 @@ sub set_password { > method => 'check_password', > }); > foreach my $plugin ( @plugins ) { >- # This plugin hook will also be used by a plugin for the Norwegian national >- # patron database. This is why we need to pass both the password and the >- # borrowernumber to the plugin. > my $ret = $plugin->check_password( > { > password => $password, >- borrowernumber => $self->borrowernumber > } > ); >- # This plugin hook will also be used by a plugin for the Norwegian national >- # patron database. This is why we need to call the actual plugins and then >- # check skip_validation afterwards. >+ # Only throw an exception if skip_validation is not in effect > if ( $ret->{'error'} == 1 && !$args->{skip_validation} ) { > Koha::Exceptions::Password::Plugin->throw(); > } >-- >2.17.1
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 27311
: 114721