Bugzilla – Attachment 80702 Details for
Bug 16694
Limit SIP2 auth by patron attribute
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for C4/SIP/Sip/MsgType.pm
MsgType.diff (text/plain), 1.63 KB, created by
Mark Alexander
on 2018-10-17 12:21:06 UTC
(
hide
)
Description:
Patch for C4/SIP/Sip/MsgType.pm
Filename:
MIME Type:
Creator:
Mark Alexander
Created:
2018-10-17 12:21:06 UTC
Size:
1.63 KB
patch
obsolete
>--- C4/SIP/Sip/MsgType.pm.orig 2018-10-13 16:38:11.380277999 -0400 >+++ C4/SIP/Sip/MsgType.pm 2018-10-17 07:59:00.488277999 -0400 >@@ -20,6 +20,7 @@ use CGI qw ( -utf8 ); > use C4::Auth qw(&check_api_auth); > > use Koha::Patron::Attributes; >+use Koha::Plugins::Handler; > > use UNIVERSAL::can; > >@@ -469,6 +470,25 @@ sub build_patron_status { > return $resp; > } > >+# Return true if the patron is valid for the particular client >+# that issued the SIP2 request. >+ >+sub check_patron { >+ my ( $patron, $server ) = @_; >+ >+ if ( $patron ) { >+ my $plugin_class = $server->{account}->{plugin_class}; >+ if ($plugin_class) { >+ return Koha::Plugins::Handler->run({ >+ class => $plugin_class, >+ method => 'sip2_validate_patron', >+ params => { patron => $patron, server => $server }, >+ }); >+ } >+ } >+ return 1; >+} >+ > sub handle_patron_status { > my ( $self, $server ) = @_; > my $ils = $server->{ils}; >@@ -480,6 +500,7 @@ sub handle_patron_status { > > $ils->check_inst_id( $fields->{ (FID_INST_ID) }, "handle_patron_status" ); > $patron = $ils->find_patron( $fields->{ (FID_PATRON_ID) } ); >+ $patron = undef unless ( check_patron ( $patron, $server ) ); > $resp = build_patron_status( $patron, $lang, $fields, $server ); > $self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); > return (PATRON_STATUS_REQ); >@@ -933,6 +954,7 @@ sub handle_patron_info { > $end = $fields->{ (FID_END_ITEM) }; > > $patron = $ils->find_patron($patron_id); >+ $patron = undef unless ( check_patron ( $patron, $server ) ); > > $resp = (PATRON_INFO_RESP); > if ($patron) {
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 16694
:
54920
|
56068
|
56442
|
56579
|
66845
|
66846
|
66847
|
66848
|
66849
|
67956
| 80702 |
80703