Lines 609-614
sub get_template_and_user {
Link Here
|
609 |
); |
609 |
); |
610 |
|
610 |
|
611 |
$template->param( OpacPublic => '1' ) if ( $user || C4::Context->preference("OpacPublic") ); |
611 |
$template->param( OpacPublic => '1' ) if ( $user || C4::Context->preference("OpacPublic") ); |
|
|
612 |
|
613 |
# guess the branch by ip if it isn't set already |
614 |
if ( C4::Context->preference("SearchMyLibraryFirst") && ! $template->param('mylibraryfirst') ) { |
615 |
my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search }; |
616 |
my $ip = $ENV{'REMOTE_ADDR'}; |
617 |
foreach my $br ( keys %$branches ) { |
618 |
my $domain = $branches->{$br}->{'branchip'}; |
619 |
if ( in_iprange($domain) ) { |
620 |
$template->param( mylibraryfirst => $branches->{$br}->{'branchcode'} ); |
621 |
} |
622 |
} |
623 |
} |
612 |
} |
624 |
} |
613 |
|
625 |
|
614 |
# Check if we were asked using parameters to force a specific language |
626 |
# Check if we were asked using parameters to force a specific language |
615 |
- |
|
|