template_name => "opac-main.tmpl",
query => $query,
type => "opac",
- authnotrequired => 1,
+ authnotrequired => 0,
flagsrequired => {borrow => 1, catalogue => '*', tools => 'import_patrons' },
}
);
template_name => "opac-main.tmpl",
query => $query,
type => "opac",
- authnotrequired => 1,
+ authnotrequired => 0,
flagsrequired => {borrow => 1, catalogue => '*', tools => 'import_patrons' },
}
);
C4::Context->interface($in->{type});
+ $in->{'authnotrequired'} ||= 0;
my $template = C4::Templates::gettemplate(
$in->{'template_name'},
$in->{'type'},
my $opac_search_limit = $ENV{'OPAC_SEARCH_LIMIT'};
my $opac_limit_override = $ENV{'OPAC_LIMIT_OVERRIDE'};
my $opac_name = '';
- if (($opac_search_limit && $opac_search_limit =~ /branch:(\w+)/ && $opac_limit_override) || ($in->{'query'}->param('limit') && $in->{'query'}->param('limit') =~ /branch:(\w+)/)){
+ if (
+ ($opac_limit_override && $opac_search_limit && $opac_search_limit =~ /branch:(\w+)/) ||
+ ($in->{'query'}->param('limit') && $in->{'query'}->param('limit') =~ /branch:(\w+)/) ||
+ ($in->{'query'}->param('multibranchlimit') && $in->{'query'}->param('multibranchlimit') =~ /multibranchlimit-(\w+)/)
+ ) {
$opac_name = $1; # opac_search_limit is a branch, so we use it.
} elsif ( $in->{'query'}->param('multibranchlimit') ) {
$opac_name = $in->{'query'}->param('multibranchlimit');
sub checkpw_internal {
my ( $dbh, $userid, $password ) = @_;
+ if ( $userid && $userid eq C4::Context->config('user') ) {
+ if ( $password && $password eq C4::Context->config('pass') ) {
+ # Koha superuser account
+# C4::Context->set_userenv(0,0,C4::Context->config('user'),C4::Context->config('user'),C4::Context->config('user'),"",1);
+ return 2;
+ }
+ else {
+ return 0;
+ }
+ }
+
my $sth =
$dbh->prepare(
"select password,cardnumber,borrowernumber,userid,firstname,surname,branchcode,flags from borrowers where userid=?"
return 1, $cardnumber, $userid;
}
}
- if ( $userid && $userid eq C4::Context->config('user')
- && "$password" eq C4::Context->config('pass') )
- {
-
-# Koha superuser account
-# C4::Context->set_userenv(0,0,C4::Context->config('user'),C4::Context->config('user'),C4::Context->config('user'),"",1);
- return 2;
- }
if ( $userid && $userid eq 'demo'
&& "$password" eq 'demo'
&& C4::Context->config('demo') )