Fix the content handler.

This commit is contained in:
Colin Kuskie 2009-05-15 21:30:21 -07:00
parent a03bab37ea
commit bff9c617ac

View file

@ -36,12 +36,15 @@ sub handler {
my ($session) = @_;
my $output = undef;
return undef unless $session->form->get('op') eq 'filePump';
my $function = "www_".$session->form->get('func');
if ($function ne "www_" && (my $sub = WebGUI::FilePump::Admin->can($function))) {
my $method = $session->form->get( 'method' )
? 'www_' . $session->form->get( 'method' )
: 'www_manage'
;
if ($method ne "www_" && (my $sub = WebGUI::FilePump::Admin->can($method))) {
$output = $sub->($session);
}
else {
WebGUI::Error::MethodNotFound->throw(error=>"Couldn't call non-existant method $function inside FilePump", method=>$function);
WebGUI::Error::MethodNotFound->throw(error=>"Couldn't call non-existant method $method inside FilePump", method=>$method);
}
return $output;
}