summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Process
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-07-19 03:13:03 +0000
committerfukachan <fukachan>2002-07-19 03:13:03 +0000
commitbc2420ffa387ec1c42275a03af07d2101bcbc7b2 (patch)
tree274888a0363b2a2ec5e042f550767acfb1806619 /fml/lib/FML/Process
parent5f771510a2a58c14279931f0dc2279af8eb5cf9f (diff)
downloadfml8-bc2420ffa387ec1c42275a03af07d2101bcbc7b2.tar.gz
fml8-bc2420ffa387ec1c42275a03af07d2101bcbc7b2.tar.bz2
fml8-bc2420ffa387ec1c42275a03af07d2101bcbc7b2.zip
cgi_execute_command() checks the command is allowed in
commands_for_admin_cgi. XXX "commands_for_admin_cgi" is hard-coded. XXX we should enhance this for ml-admin/*.cgi et.al.
Diffstat (limited to 'fml/lib/FML/Process')
-rw-r--r--fml/lib/FML/Process/CGI/Kernel.pm25
1 files changed, 22 insertions, 3 deletions
diff --git a/fml/lib/FML/Process/CGI/Kernel.pm b/fml/lib/FML/Process/CGI/Kernel.pm
index f64d4a2c..852cc401 100644
--- a/fml/lib/FML/Process/CGI/Kernel.pm
+++ b/fml/lib/FML/Process/CGI/Kernel.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Kernel.pm,v 1.39 2002/07/02 04:00:33 fukachan Exp $
+# $FML: Kernel.pm,v 1.40 2002/07/17 12:13:25 fukachan Exp $
#
package FML::Process::CGI::Kernel;
@@ -338,6 +338,22 @@ execute specified command given as FML::Command::*
sub cgi_execute_command
{
my ($curproc, $args, $command_args) = @_;
+ my $commode = $command_args->{ command_mode };
+ my $comname = $command_args->{ comname };
+ my $config = $curproc->config();
+
+ unless ($config->has_attribute("commands_for_admin_cgi", $comname)) {
+ LogError("cgi deny command: mode=$commode level=cgi");
+
+ my $buf = $curproc->message_nl("cgi.deny",
+ "Error: deny $comname command");
+ print $buf, "<BR>\n";
+
+ return;
+ }
+ else {
+ Log("run $comname mode=$commode level=cgi");
+ }
use FML::Command;
my $obj = new FML::Command;
@@ -352,9 +368,12 @@ sub cgi_execute_command
else {
print "Error! $comname fails.\n<BR>\n";
if ($@ =~ /^(.*)\s+at\s+/) {
- my $reason = $@;
+ my $reason = $@;
+ my ($key, $r) = $curproc->parse_exception($reason);
+ my $buf = $curproc->message_nl($key);
+
print "<BR>\n";
- print $reason;
+ print ($buf || $reason);
print "<BR>\n";
}
}