From a8fdac38d8a1cf9e996195c5b04702d1d2eaa106 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 16 Aug 2016 14:02:58 +0100 Subject: [PATCH] Bug 9569: Fix AutoLocation - handle .* for subnets The example in branches.tt is: Can be entered as a single IP, or a subnet such as 192.168.1.* But actually the regex in C4::Auth does not handle subnets. Test plan: 0/ Apply all the patches 1/ Switch AutoLocation on 2/ Define a subnet (192.168.0.* if your ip is like 192.168.0.X) in the IP range of your library 3/ Log in on the staff interface => Should work Signed-off-by: Chris Cormack Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall --- C4/Auth.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/Auth.pm b/C4/Auth.pm index 2a00a208f5..f82a0629e1 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -1055,6 +1055,7 @@ sub checkauth { # we have to check they are coming from the right ip range my $domain = $branches->{$branchcode}->{'branchip'}; + $domain =~ s|\.\*||g; if ( $ip !~ /^$domain/ ) { $loggedin = 0; $info{'wrongip'} = 1; -- 2.39.5