more session changes

This commit is contained in:
JT Smith 2006-01-02 02:54:23 +00:00
parent 657ae8baf7
commit f429daa942
27 changed files with 857 additions and 666 deletions

View file

@ -49,6 +49,7 @@ The name of the operation to execute.
=cut
sub execute {
my $session = shift;
my $op = shift;
my ($output, $cmd);
my $operation = getOperations();
@ -56,13 +57,13 @@ sub execute {
# Load the module
$cmd = 'use '.$operation->{$op};
eval ($cmd);
WebGUI::ErrorHandler::error("Couldn't compile operation: ".$operation->{$op}.". Root cause: ".$@) if ($@);
$session->error("Couldn't compile operation: ".$operation->{$op}.". Root cause: ".$@) if ($@);
# Call the method
$cmd = $operation->{$op} . '::www_'.$op;
$output = eval($cmd);
WebGUI::ErrorHandler::error("Couldn't execute operation : ".$cmd.". Root cause: ".$@) if ($@);
$output = eval{&$cmd($session)};
$session->error("Couldn't execute operation : ".$cmd.". Root cause: ".$@) if ($@);
} else {
WebGUI::ErrorHandler::security("execute an invalid operation: ".$op);
$session->security("execute an invalid operation: ".$op);
}
return $output;
}