convert WebGUI to a mod perl handler

This commit is contained in:
JT Smith 2005-11-03 09:14:23 +00:00
parent ec9d561c5a
commit 9b23c24a6a
13 changed files with 198 additions and 101 deletions

View file

@ -13,12 +13,7 @@ package WebGUI::UploadsAccessHandler;
our $webguiRoot;
BEGIN {
my $s;
if ($mod_perl::VERSION >= 1.999023) {
$s = Apache2::ServerUtil->server;
} else {
$s = Apache->server;
}
my $s = Apache2::ServerUtil->server;
$webguiRoot = $s->dir_config('WebguiRoot');
unshift (@INC, $webguiRoot."/lib");
}
@ -35,15 +30,9 @@ sub handler {
my $r;
my $ok;
my $notfound;
if ($mod_perl::VERSION >= 1.999023) {
$r = Apache2::RequestUtil->request;
$ok = Apache2::Const::OK();
$notfound = Apache2::Const::NOT_FOUND();
} else {
$r = Apache->request;
$ok = Apache::OK();
$notfound = Apache::NOT_FOUND();
}
if (-e $r->filename) {
my $path = $r->filename;
$path =~ s/^(\/.*\/).*$/$1/;