Bug 36940: Resolve two warnings on undefined branchip
If you enabled AutoLocation and have a branch without ip, this triggers warnings. Test plan: Check logs in this situation with/without this patch by logging out and in again on staff. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
865ca8b1fc
commit
2f1ffbc6ec
1 changed files with 2 additions and 2 deletions
|
@ -1218,10 +1218,10 @@ sub checkauth {
|
|||
my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search->as_list };
|
||||
if ( C4::Context->preference('StaffLoginRestrictLibraryByIP') ) {
|
||||
# we have to check they are coming from the right ip range
|
||||
my $domain = $branches->{$branchcode}->{'branchip'};
|
||||
my $domain = $branches->{$branchcode}->{'branchip'} // q{};
|
||||
$domain =~ s|\.\*||g;
|
||||
$domain =~ s/\s+//g;
|
||||
if ( $ip !~ /^$domain/ ) {
|
||||
if ( $domain && $ip !~ /^$domain/ ) {
|
||||
$cookie = $cookie_mgr->replace_in_list( $cookie, $query->cookie(
|
||||
-name => 'CGISESSID',
|
||||
-value => '',
|
||||
|
|
Loading…
Reference in a new issue