require Exporter;
use C4::Context;
-use C4::Output; # to get the template
+use C4::Templates; # to get the template
use C4::Members;
use C4::Koha;
use C4::Branch; # GetBranches
sub get_template_and_user {
my $in = shift;
my $template =
- gettemplate( $in->{'template_name'}, $in->{'type'}, $in->{'query'} );
- my ( $user, $cookie, $sessionID, $flags ) = checkauth(
- $in->{'query'},
- $in->{'authnotrequired'},
- $in->{'flagsrequired'},
- $in->{'type'}
- ) unless ($in->{'template_name'}=~/maintenance/);
+ C4::Templates::gettemplate( $in->{'template_name'}, $in->{'type'}, $in->{'query'} );
+ my ( $user, $cookie, $sessionID, $flags );
+ if ( $in->{'template_name'} !~m/maintenance/ ) {
+ ( $user, $cookie, $sessionID, $flags ) = checkauth(
+ $in->{'query'},
+ $in->{'authnotrequired'},
+ $in->{'flagsrequired'},
+ $in->{'type'}
+ );
+ }
my $borrowernumber;
my $insecure = C4::Context->preference('insecure');
"BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
EnhancedMessagingPreferences => C4::Context->preference('EnhancedMessagingPreferences'),
GoogleJackets => C4::Context->preference("GoogleJackets"),
+ OpenLibraryCovers => C4::Context->preference("OpenLibraryCovers"),
KohaAdminEmailAddress => "" . C4::Context->preference("KohaAdminEmailAddress"),
LoginBranchcode => (C4::Context->userenv?C4::Context->userenv->{"branch"}:"insecure"),
LoginFirstname => (C4::Context->userenv?C4::Context->userenv->{"firstname"}:"Bel"),
opac_limit_override => $opac_limit_override,
OpacBrowser => C4::Context->preference("OpacBrowser"),
OpacCloud => C4::Context->preference("OpacCloud"),
+ OpacKohaUrl => C4::Context->preference("OpacKohaUrl"),
OpacMainUserBlock => "" . C4::Context->preference("OpacMainUserBlock"),
OpacNav => "" . C4::Context->preference("OpacNav"),
OpacPasswordChange => C4::Context->preference("OpacPasswordChange"),
}
my $template_name = ( $type eq 'opac' ) ? 'opac-auth.tmpl' : 'auth.tmpl';
- my $template = gettemplate( $template_name, $type, $query );
+ my $template = C4::Templates::gettemplate( $template_name, $type, $query );
$template->param(branchloop => \@branch_loop,);
my $checkstyle = C4::Context->preference("opaccolorstylesheet");
if ($checkstyle =~ /\//)