3 ############################################################################
4 # soepkiptng (c) copyright 2000 Eric Lammerts <eric@lammerts.org>.
7 ############################################################################
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License, version 2, as
10 # published by the Free Software Foundation.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 ############################################################################
24 # find program directory
27 my $l = readlink or die "readlink $_: $!\n";
28 if($l =~ m
|^/|) { $_ = $l; } else { s|[^/]*$|/$l|; }
31 (my $progdir = Cwd
::abs_path
($1)) =~ s
|/+[^/]+$||;
33 require "$progdir/soepkiptng.lib";
34 require "$progdir/soepkiptng_web.lib";
37 ############################################################################
41 my $r = Apache
->request;
42 $r->content_type("text/html; charset=ISO-8859-15");
46 sub require_write_access
() {
47 if($conf{write_access_func
} &&
48 !eval $conf{write_access_func
}) {
51 printhdr
($conf{allstyle
});
52 print "<b>Access Denied.</b>\n";
59 ############################################################################
62 read_configfile
(\
%conf);
64 my $dbh = DBI
->connect("DBI:mysql:$conf{db_name}:$conf{db_host}",
65 $conf{db_user
},$conf{db_pass
}, {mysql_client_found_rows
=>1 })
66 or die "can't connect to database...$!\n";
68 my $cgiquery = new CGI
;
70 my $r = Apache
->request;
75 $req->{cgiquery
} = $cgiquery;
76 $req->{self
} = $cgiquery->script_name();
77 $req->{host
} = $r->header_in('X-Forwarded-For') || $r->get_remote_host();