Bug 24537: Tidy code
authorKyle M Hall <kyle@bywatersolutions.com>
Wed, 1 Apr 2020 10:19:24 +0000 (06:19 -0400)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 6 Apr 2020 10:01:03 +0000 (11:01 +0100)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

opac/ilsdi.pl

index c9c01a9..e1215cf 100755 (executable)
@@ -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}.";
     }
 }