quick fix to throw away searches with less than 3 characters in the search
[koha.git] / mainpage.pl
1 #!/usr/bin/perl
2 use HTML::Template;
3 use strict;
4 require Exporter;
5 use C4::Database;
6 use C4::Output;  # contains picktemplate
7 use CGI;
8 use C4::Auth;
9
10 my $query = new CGI;
11 my ($loggedinuser, $cookie, $sessionID) = checkauth($query);
12
13 my %configfile;
14 open (KC, "/etc/koha.conf");
15 while (<KC>) {
16  chomp;
17  (next) if (/^\s*#/);
18  if (/(.*)\s*=\s*(.*)/) {
19    my $variable=$1;
20    my $value=$2;
21    # Clean up white space at beginning and end
22    $variable=~s/^\s*//g;
23    $variable=~s/\s*$//g;
24    $value=~s/^\s*//g;
25    $value=~s/\s*$//g;
26    $configfile{$variable}=$value;
27  }
28 }
29
30 my $includes=$configfile{'includes'};
31 ($includes) || ($includes="/usr/local/www/hdl/htdocs/includes");
32 my $templatebase="catalogue/intranet-main.tmpl";
33 my $theme=picktemplate($includes, $templatebase);
34
35 my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
36
37 #$template->param(SITE_RESULTS => $sitearray);
38 print "Content-Type: text/html\n\n", $template->output;