1 #!/usr/bin/speedy -- -M4 -t600 -r100 -gsoepkiptng
3 ############################################################################
4 # soepkiptng (c) copyright 2000 Eric Lammerts <eric@lammerts.org>.
5 ############################################################################
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License, version 2, as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 ############################################################################
31 # find program directory
34 my $l = readlink or die "readlink $_: $!\n";
35 if($l =~ m|^/|) { $_ = $l; } else { s|[^/]*$|/$l|; }
38 $progdir = abs_path($1);
41 require "$progdir/soepkiptng.lib";
42 require "$progdir/soepkiptng_web.lib";
44 ############################################################################
52 $cookie = $cgiquery->cookie(
58 print $cgiquery->header(
59 -type=>"text/html; charset=ISO-8859-15",
63 sub require_write_access() {
64 if($conf{write_access_func} &&
65 !eval $conf{write_access_func}) {
68 printhdr($conf{allstyle});
69 print "<b>Access Denied.</b>\n";
76 ############################################################################
79 my $sp = CGI::SpeedyCGI->new;
82 %conf or read_configfile(\%conf);
84 #$conf{db_user} = "soepkiptng_pub";
85 #$conf{db_pass} = "soepkiptng_pub";
87 # (re)open database connection if necessary
89 if(!$dbh || !$dbh->ping) {
90 $dbh = DBI->connect("DBI:mysql:$conf{db_name}:$conf{db_host}",
91 $conf{db_user}, $conf{db_pass}, {mysql_client_found_rows => 1 })
92 or die "Can't connect to database $conf{db_name}\@$conf{db_host} as user $conf{db_user}\n";
94 $sp->add_shutdown_handler(sub { $dbh and $dbh->logout; });
96 our $cgiquery = new CGI;
100 $req->{cgiquery} = $cgiquery;
101 $req->{self} = $cgiquery->script_name();
102 $req->{host} = $cgiquery->remote_host();
103 my %cookies = $cgiquery->cookie('sv');
104 $req->{cookies} = \%cookies;
106 handle_request($req);