View | Details | Raw Unified | Return to bug 35918
Collapse All | Expand All

(-)a/C4/Auth.pm (-8 / +11 lines)
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 1211-1225 sub checkauth { Link Here
1211
                        }
1212
                        }
1212
                    }
1213
                    }
1213
1214
1214
                    foreach my $br ( keys %$branches ) {
1215
                    if ( C4::Context->preference('AutoLocation') && $auth_state ne 'failed' ) {
1216
                        foreach my $br ( uniq( $branchcode, keys %$branches ) ) {
1215
1217
1216
                        #     now we work with the treatment of ip
1218
                            #     now we work with the treatment of ip
1217
                        my $domain = $branches->{$br}->{'branchip'};
1219
                            my $domain = $branches->{$br}->{'branchip'};
1218
                        if ( $domain && $ip =~ /^$domain/ ) {
1220
                            if ( $domain && $ip =~ /^$domain/ ) {
1219
                            $branchcode = $branches->{$br}->{'branchcode'};
1221
                                $branchcode = $branches->{$br}->{'branchcode'};
1220
1222
1221
                            # new op dev : add the branchname to the cookie
1223
                                # new op dev : add the branchname to the cookie
1222
                            $branchname    = $branches->{$br}->{'branchname'};
1224
                                $branchname = $branches->{$br}->{'branchname'};
1225
                                last;
1226
                            }
1223
                        }
1227
                        }
1224
                    }
1228
                    }
1225
1229
1226
- 

Return to bug 35918