Lines 635-640
sub get_template_and_user {
Link Here
|
635 |
); |
635 |
); |
636 |
|
636 |
|
637 |
$template->param( OpacPublic => '1' ) if ( $user || C4::Context->preference("OpacPublic") ); |
637 |
$template->param( OpacPublic => '1' ) if ( $user || C4::Context->preference("OpacPublic") ); |
|
|
638 |
|
639 |
# guess the branch by ip if it isn't set already |
640 |
if ( C4::Context->preference("SearchMyLibraryFirst") && ! $template->param('mylibraryfirst') ) { |
641 |
my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search }; |
642 |
my $ip = $ENV{'REMOTE_ADDR'}; |
643 |
foreach my $br ( keys %$branches ) { |
644 |
my $domain = $branches->{$br}->{'branchip'}; |
645 |
if ( in_iprange($domain) ) { |
646 |
$template->param( mylibraryfirst => $branches->{$br}->{'branchcode'} ); |
647 |
} |
648 |
} |
649 |
} |
638 |
} |
650 |
} |
639 |
|
651 |
|
640 |
# Check if we were asked using parameters to force a specific language |
652 |
# Check if we were asked using parameters to force a specific language |
641 |
- |
|
|