summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Process/Command.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-02-17 03:07:55 +0000
committerfukachan <fukachan>2002-02-17 03:07:55 +0000
commitab2ef9ed7dcb834731c6a853c246fe5de6f8cc72 (patch)
tree42f936400436188af258a88b4ac257befa8def90 /fml/lib/FML/Process/Command.pm
parent6c32f087e4c064b9c678a086d1bd1d5df9f5e756 (diff)
downloadfml8-ab2ef9ed7dcb834731c6a853c246fe5de6f8cc72.tar.gz
fml8-ab2ef9ed7dcb834731c6a853c246fe5de6f8cc72.tar.bz2
fml8-ab2ef9ed7dcb834731c6a853c246fe5de6f8cc72.zip
implement several hooks
Diffstat (limited to 'fml/lib/FML/Process/Command.pm')
-rw-r--r--fml/lib/FML/Process/Command.pm30
1 files changed, 28 insertions, 2 deletions
diff --git a/fml/lib/FML/Process/Command.pm b/fml/lib/FML/Process/Command.pm
index e167ace4..1ebbec64 100644
--- a/fml/lib/FML/Process/Command.pm
+++ b/fml/lib/FML/Process/Command.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2000,2001,2002 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Command.pm,v 1.30 2002/02/11 12:29:27 fukachan Exp $
+# $FML: Command.pm,v 1.31 2002/02/13 10:39:33 fukachan Exp $
#
package FML::Process::Command;
@@ -75,7 +75,14 @@ forward the request to SUPER CLASS.
sub prepare
{
my ($self, $args) = @_;
+
+ my $eval = $config->get_hook( 'command_prepare_start_hook' );
+ if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; }
+
$self->SUPER::prepare($args);
+
+ $eval = $config->get_hook( 'command_prepare_end_hook' );
+ if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; }
}
@@ -93,7 +100,14 @@ verify the sender is a valid member or not.
sub verify_request
{
my ($curproc, $args) = @_;
+
+ my $eval = $config->get_hook( 'command_verify_request_start_hook' );
+ if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; }
+
$curproc->verify_sender_credential();
+
+ $eval = $config->get_hook( 'command_verify_request_end_hook' );
+ if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; }
}
@@ -162,8 +176,14 @@ sub finish
{
my ($curproc, $args) = @_;
+ my $eval = $config->get_hook( 'command_finish_start_hook' );
+ if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; }
+
$curproc->inform_reply_messages();
$curproc->queue_flush();
+
+ $eval = $config->get_hook( 'command_finish_end_hook' );
+ if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; }
}
@@ -293,6 +313,9 @@ sub _evaluate_command
my @body = split(/\n/, $body);
my $id = $curproc->_pre_scan( \@body ); # confirmation reply ?
+ my $eval = $config->get_hook( 'command_run_start_hook' );
+ if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; }
+
$curproc->reply_message("result for your command requests follows:");
COMMAND:
@@ -310,7 +333,7 @@ sub _evaluate_command
# Case: not "confirm" reply message.
# check whether we need to accpet this command ?
# we accpet commands from ML members only by default.
- #
+ #
# validate general command except for confirmation
# if $id is 1, this message must be confirmation reply.
unless ($command =~ /$keyword/ && defined($id)) {
@@ -363,6 +386,9 @@ sub _evaluate_command
}
}
} # END OF FOR LOOP: for my $command (@body) { ... }
+
+ $eval = $config->get_hook( 'command_run_end_hook' );
+ if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; }
}