LoginSurname => C4::Context->userenv?C4::Context->userenv->{"surname"}:"Inconnu",
TagsEnabled => C4::Context->preference("TagsEnabled"),
hide_marc => C4::Context->preference("hide_marc"),
+ dateformat => C4::Context->preference("dateformat"),
'item-level_itypes' => C4::Context->preference('item-level_itypes'),
patronimages => C4::Context->preference("patronimages"),
singleBranchMode => C4::Context->preference("singleBranchMode"),
$LibraryNameTitle =~ s/<(?:\/?)(?:br|p)\s*(?:\/?)>/ /sgi;
$LibraryNameTitle =~ s/<(?:[^<>'"]|'(?:[^']*)'|"(?:[^"]*)")*>//sg;
$template->param(
- AmazonContent => "" . C4::Context->preference("AmazonContent"),
+ OPACAmazonContent => "" . C4::Context->preference("OPACAmazonContent"),
AnonSuggestions => "" . C4::Context->preference("AnonSuggestions"),
AuthorisedValueImages => C4::Context->preference("AuthorisedValueImages"),
LibraryName => "" . C4::Context->preference("LibraryName"),
virtualshelves => "" . C4::Context->preference("virtualshelves"),
);
}
- $template->param(listloop=>[{shelfname=>"Freelist", shelfnumber=>110}]);
return ( $template, $borrowernumber, $cookie, $flags);
}
Verifies that the user is authorized to run this script. If
the user is authorized, a (userid, cookie, session-id, flags)
-quadruple is returned. If the user is not authorized but does
-not have the required privilege (see $flagsrequired below), it
+quadruple is returned. If the user is not authorized due to
+insufficent privileges (see $flagsrequired below), it
displays an error page and exits. Otherwise, it displays the
login page and exits.
# and the number of lists to be displayed of each type in the 'Lists' button drop down
my $row_count = 10; # FIXME:This probably should be a syspref
my ($total, $totshelves, $barshelves, $pubshelves);
- ($barshelves, $totshelves) = GetRecentShelves(1, $row_count, $borrowernumber);
+ ($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber);
$total->{'bartotal'} = $totshelves;
- ($pubshelves, $totshelves) = GetRecentShelves(2, $row_count, undef);
+ ($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
$total->{'pubtotal'} = $totshelves;
- $session->param('barshelves', ${@$barshelves}[0]);
- $session->param('pubshelves', ${@$pubshelves}[0]);
+ $session->param('barshelves', $barshelves->[0]);
+ $session->param('pubshelves', $pubshelves->[0]);
$session->param('totshelves', $total);
- C4::Context::set_shelves_userenv('bar',${@$barshelves}[0]);
- C4::Context::set_shelves_userenv('pub',${@$pubshelves}[0]);
+ C4::Context::set_shelves_userenv('bar',$barshelves->[0]);
+ C4::Context::set_shelves_userenv('pub',$pubshelves->[0]);
C4::Context::set_shelves_userenv('tot',$total);
}
else {
# Grab the public shelves and add to the session...
my $row_count = 20; # FIXME:This probably should be a syspref
my ($total, $totshelves, $pubshelves);
- ($pubshelves, $totshelves) = GetRecentShelves(2, $row_count, undef);
+ ($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
$total->{'pubtotal'} = $totshelves;
- $session->param('pubshelves', ${@$pubshelves}[0]);
- $session->param('pubtotal', $total->{'pubtotal'});
- C4::Context::set_shelves_userenv('pub',${@$pubshelves}[0]);
+ $session->param('pubshelves', $pubshelves->[0]);
+ $session->param('totshelves', $total);
+ C4::Context::set_shelves_userenv('pub',$pubshelves->[0]);
C4::Context::set_shelves_userenv('tot',$total);
# setting a couple of other session vars...
my ( $dbh, $userid, $password ) = @_;
if ($ldap) {
- $debug and print "## checkpw - checking LDAP\n";
+ $debug and print STDERR "## checkpw - checking LDAP\n";
my ($retval,$retcard) = checkpw_ldap(@_); # EXTERNAL AUTH
($retval) and return ($retval,$retcard);
}
my $userid = shift;
my $dbh = C4::Context->dbh;
- my $sth = $dbh->prepare("SELECT flag, code
+ my $sth = $dbh->prepare("SELECT flag, user_permissions.code as code
FROM user_permissions
JOIN permissions USING (module_bit, code)
- JOIN userflags ON (module_bit = bit)
- JOIN borrowers USING (borrowernumber)
+ JOIN userflags ON (permissions.module_bit = userflags.bit)
+ JOIN borrowers ON (user_permissions.borrowernumber=borrowers.borrowernumber)
WHERE userid = ?");
$sth->execute($userid);