Bugzilla – Attachment 102214 Details for
Bug 24537
Add support for IP ranges in ILS-DI:AuthorizedIPs using Net::Netmask
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24537: Tidy code
Bug-24537-Tidy-code.patch (text/plain), 1.50 KB, created by
Kyle M Hall (khall)
on 2020-04-01 10:29:20 UTC
(
hide
)
Description:
Bug 24537: Tidy code
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-04-01 10:29:20 UTC
Size:
1.50 KB
patch
obsolete
>From 293863cd21793e97c5511576d7f52ea186aab9e1 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 1 Apr 2020 06:19:24 -0400 >Subject: [PATCH] Bug 24537: Tidy code > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > opac/ilsdi.pl | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/opac/ilsdi.pl b/opac/ilsdi.pl >index c9c01a9ce0..e1215cf75b 100755 >--- a/opac/ilsdi.pl >+++ b/opac/ilsdi.pl >@@ -164,19 +164,19 @@ unless ( C4::Context->preference('ILS-DI') ) { > } > > # If the remote address is not allowed, redirect to 403 >-my @AuthorizedIPs = split(/,/, C4::Context->preference('ILS-DI:AuthorizedIPs')); >-if ( @AuthorizedIPs ){ # If no filter set, allow access to everybody >+my @AuthorizedIPs = split( /,/, C4::Context->preference('ILS-DI:AuthorizedIPs') ); >+if (@AuthorizedIPs) { # If no filter set, allow access to everybody > my $authorized = 0; >- foreach my $ip (@AuthorizedIPs){ >+ foreach my $ip (@AuthorizedIPs) { > my $netmask = Net::Netmask->new2($ip); >- if ( $netmask && $netmask->match($ENV{'REMOTE_ADDR'}) ){ >+ if ( $netmask && $netmask->match( $ENV{REMOTE_ADDR} ) ) { > $authorized = 1; > last; > } > } >- unless ($authorized){ >+ unless ($authorized) { > $out->{'code'} = "NotAllowed"; >- $out->{'message'} = "Unauthorized IP address: ".$ENV{'REMOTE_ADDR'}."."; >+ $out->{'message'} = "Unauthorized IP address: $ENV{REMOTE_ADDR}."; > } > } > >-- >2.24.1 (Apple Git-126)
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 24537
:
98105
|
102172
|
102213
| 102214