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>
(cherry picked from commit 2f1ffbc6ec)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
e7afd54cc8
commit
2d4537ba12
|
|
@ -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 New Issue