summaryrefslogtreecommitdiff
path: root/fml/lib
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-05-02 07:57:54 +0000
committerfukachan <fukachan>2003-05-02 07:57:54 +0000
commit2c86b6211f366e468e68e7e850bdfd525b306caf (patch)
tree7c036dd8ba2a32c9d176fc445be7f4cfd1790d41 /fml/lib
parent738dd25f7aa014ee940b25443eeba302e298cd8d (diff)
downloadfml8-2c86b6211f366e468e68e7e850bdfd525b306caf.tar.gz
fml8-2c86b6211f366e468e68e7e850bdfd525b306caf.tar.bz2
fml8-2c86b6211f366e468e68e7e850bdfd525b306caf.zip
define $post_restrictions_reject_notice_data_type.
enable choice of ways how to notify rejection as string or multipart in denial of post?
Diffstat (limited to 'fml/lib')
-rw-r--r--fml/lib/FML/Process/Distribute.pm43
1 files changed, 29 insertions, 14 deletions
diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm
index ec876b6e..a388f1ab 100644
--- a/fml/lib/FML/Process/Distribute.pm
+++ b/fml/lib/FML/Process/Distribute.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2000,2001,2002,2003 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Distribute.pm,v 1.111 2003/03/17 09:01:17 fukachan Exp $
+# $FML: Distribute.pm,v 1.112 2003/03/18 10:42:45 fukachan Exp $
#
package FML::Process::Distribute;
@@ -197,6 +197,13 @@ sub run
my $config = $curproc->{ config };
my $maintainer = $config->{ maintainer };
my $sender = $curproc->{'credential'}->{'sender'};
+ my $data_type =
+ $config->{post_restrictions_reject_notice_data_type} || 'string';
+ my $msg_args = {
+ _arg_address => $sender,
+ _arg_sender => $sender,
+ recipient => $sender,
+ };
my $eval = $config->get_hook( 'distribute_run_start_hook' );
if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; }
@@ -214,36 +221,44 @@ sub run
my $rule = $pcb->get("check_restrictions", "deny_reason");
if ($rule eq 'reject_system_accounts') {
my $r = "deny request from a system account";
- $curproc->reply_message_nl("error.system_accounts", $r);
+ $curproc->reply_message_nl("error.system_accounts",
+ $r, $msg_args);
}
elsif ($rule eq 'permit_member_maps') {
my $r = "deny request from a not member";
- $curproc->reply_message_nl("error.not_member", $r);
+ $curproc->reply_message_nl("error.not_member", $r, $msg_args);
}
elsif ($rule eq 'reject') {
my $r = "deny your request";
- $curproc->reply_message_nl("error.reject_post", $r);
+ $curproc->reply_message_nl("error.reject_post", $r, $msg_args);
}
else {
my $r = "deny your request due to an unknown reason";
- $curproc->reply_message_nl("error.reject_post", $r);
+ $curproc->reply_message_nl("error.reject_post", $r, $msg_args);
}
+ # send back deny request with the original message.
my $msg = $curproc->incoming_message();
- $curproc->reply_message( $msg );
+ if ($data_type eq 'string') {
+ my $s = $msg->whole_message_as_str( { indent => ' ' } );
+ $curproc->reply_message(sprintf("\n\n%s", $s), $msg_args);
+ }
+ else {
+ $curproc->reply_message( $msg, $msg_args );
+ }
# inform maintainer too.
- my $msg_args = {
- _arg_address => $sender,
- recipient => $maintainer,
- };
+ $msg_args->{ recipient } = $maintainer;
$curproc->reply_message_nl("error.post_from_not_member",
"post from not a member",
$msg_args);
- $curproc->reply_message( $msg, $msg_args );
-
- # add header info.
- $curproc->reply_message_add_header_info();
+ if ($data_type eq 'string') {
+ my $s = $msg->whole_message_as_str( { indent => ' ' } );
+ $curproc->reply_message(sprintf("\n\n%s", $s), $msg_args );
+ }
+ else {
+ $curproc->reply_message( $msg, $msg_args );
+ }
}
}
else {