Koha/opac/opac-restrictedpage.pl
Jonathan Druart c4eabeda0b Bug 16447: Remove occurrence of the borrow permission which does no longer exist
Bug 7976 has removed this permission, but other patches re-added it...
Note that the occurrences in sendbasket.pl, edithelp.pl, opac/svc/login should
have been removed by bug 7976.

Test plan:
  git grep 'borrow.*=> 1'
should not return any results.

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
2016-05-05 21:28:14 +00:00

47 lines
1.4 KiB
Perl
Executable file

#!/usr/bin/perl
# Copyright Solutions inLibro inc 2014
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version .
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use Modern::Perl;
use CGI;
use C4::Auth;
use C4::Output;
my $localNetwork = C4::Context->preference('RestrictedPageLocalIPs');
my $userIP = $ENV{'REMOTE_ADDR'};
my $withinNetwork = 0;
foreach my $IPRange ( split( ',', $localNetwork ) )
{
$withinNetwork = ( $userIP =~ /^$IPRange/ );
last if $withinNetwork;
}
my $query = new CGI;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "opac-restrictedpage.tt",
query => $query,
type => "opac",
authnotrequired => $withinNetwork,
debug => 1,
}
);
output_html_with_http_headers $query, $cookie, $template->output;