From 1db4fba39258901c2a97574e6f263d0b86b2ac8a 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: Mason James --- C4/Auth.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/Auth.pm b/C4/Auth.pm index 582eefc621..b99b70b9a9 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -1083,6 +1083,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