Lines 26-31
use CGI::Session;
Link Here
|
26 |
use CGI::Session::ErrorHandler; |
26 |
use CGI::Session::ErrorHandler; |
27 |
use URI; |
27 |
use URI; |
28 |
use URI::QueryParam; |
28 |
use URI::QueryParam; |
|
|
29 |
use List::MoreUtils qw( uniq ); |
29 |
|
30 |
|
30 |
use C4::Context; |
31 |
use C4::Context; |
31 |
use C4::Templates; # to get the template |
32 |
use C4::Templates; # to get the template |
Lines 1213-1227
sub checkauth {
Link Here
|
1213 |
} |
1214 |
} |
1214 |
} |
1215 |
} |
1215 |
|
1216 |
|
1216 |
foreach my $br ( keys %$branches ) { |
1217 |
if ( C4::Context->preference('AutoLocation') && $auth_state ne 'failed' ) { |
|
|
1218 |
foreach my $br ( uniq( $branchcode, keys %$branches ) ) { |
1217 |
|
1219 |
|
1218 |
# now we work with the treatment of ip |
1220 |
# now we work with the treatment of ip |
1219 |
my $domain = $branches->{$br}->{'branchip'}; |
1221 |
my $domain = $branches->{$br}->{'branchip'}; |
1220 |
if ( $domain && $ip =~ /^$domain/ ) { |
1222 |
if ( $domain && $ip =~ /^$domain/ ) { |
1221 |
$branchcode = $branches->{$br}->{'branchcode'}; |
1223 |
$branchcode = $branches->{$br}->{'branchcode'}; |
1222 |
|
1224 |
|
1223 |
# new op dev : add the branchname to the cookie |
1225 |
# new op dev : add the branchname to the cookie |
1224 |
$branchname = $branches->{$br}->{'branchname'}; |
1226 |
$branchname = $branches->{$br}->{'branchname'}; |
|
|
1227 |
last; |
1228 |
} |
1225 |
} |
1229 |
} |
1226 |
} |
1230 |
} |
1227 |
|
1231 |
|
1228 |
- |
|
|