Bugzilla – Attachment 80703 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]
Relevant code from patron validator plugin
Sip2patron.pm.excerpt (text/plain), 1.09 KB, created by
Mark Alexander
on 2018-10-17 12:24:12 UTC
(
hide
)
Description:
Relevant code from patron validator plugin
Filename:
MIME Type:
Creator:
Mark Alexander
Created:
2018-10-17 12:24:12 UTC
Size:
1.09 KB
patch
obsolete
>package Koha::Plugin::Com::Bloovis::Sip2patron; > ># [... boilerplate code deleted ... ] > >## The existence of a 'sip2_validate_patron' subroutine means >## the plugin is capable of validating a patron for the SIP2 server. >## Return a true value if the patron is valid; false otherwise. > >my @kanopy_ips = ( > "::ffff:192.168.122.1", # for testing only! > "208.66.24.46", > "104.239.197.182", > "18.209.148.51", > "34.232.89.121", > "34.234.81.211", > "34.235.227.70", > "34.235.53.173", > "52.203.108.44" >); > >sub sip2_validate_patron { > my ( $self, $args ) = @_; > > my $patron = $args->{patron}; > my $server = $args->{server}; > > if ( $patron ) { > my $ipaddr = $server->{server}->{client}->peerhost; > foreach my $kanopy ( @kanopy_ips ) { > if ( $ipaddr =~ /^(::ffff:)?\Q$kanopy\E$/ ) { > my $borrowernumber = $patron->{borrowernumber}; > my $value = C4::Members::Attributes::GetBorrowerAttributeValue( $borrowernumber, 'KANOPY_OK' ); > return $value eq "1"; > } > } > } > return 1; >} > ># [... boilerplate code deleted ... ]
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 Raw
Actions:
View
Attachments on
bug 16694
:
54920
|
56068
|
56442
|
56579
|
66845
|
66846
|
66847
|
66848
|
66849
|
67956
|
80702
| 80703