adding authentification with Auth.pm
[koha.git] / opac / opac-search.pl
1 #!/usr/bin/perl
2 use strict;
3 require Exporter;
4
5 use C4::Auth;
6 use CGI;
7 use C4::Database;
8
9 my $classlist='';
10
11 my $dbh=C4Connect;
12 my $sth=$dbh->prepare("select groupname,itemtypes from itemtypesearchgroups order by groupname");
13 $sth->execute;
14 while (my ($groupname,$itemtypes) = $sth->fetchrow) {
15     $classlist.="<option value=\"$itemtypes\">$groupname\n";
16 }
17
18
19 my $query = new CGI;
20
21 my ($template, $borrowernumber, $cookie) 
22     = get_template_and_user({template_name => "opac-search.tmpl",
23                              query => $query,
24                              type => "opac",
25                              authnotrequired => 1,
26                              flagsrequired => {borrow => 1},
27                          });
28
29
30 $template->param(classlist => $classlist);
31
32 print $query->header(-cookie => $cookie), $template->output;