diff options
| author | fukachan <fukachan> | 2002-07-14 15:15:27 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-07-14 15:15:27 +0000 |
| commit | 791073bd93a78124f348ca70d045f671c2f4eabb (patch) | |
| tree | 9bf9ab513db02935a9a43e25851cca4b87efce91 /fml/lib/FML/Command | |
| parent | 4345159846ffb68770a0b6794decb84eb5eba9e9 (diff) | |
| download | fml8-791073bd93a78124f348ca70d045f671c2f4eabb.tar.gz fml8-791073bd93a78124f348ca70d045f671c2f4eabb.tar.bz2 fml8-791073bd93a78124f348ca70d045f671c2f4eabb.zip | |
copy message and send it to $maintainer too
use reply_message*() with $msg_args to copy the message if needed where
$msg_args = { always_cc => $maintainer } or
$msg_args = { recipient => $maintinaer } pertinently.
Diffstat (limited to 'fml/lib/FML/Command')
| -rw-r--r-- | fml/lib/FML/Command/User/confirm.pm | 16 | ||||
| -rw-r--r-- | fml/lib/FML/Command/UserControl.pm | 50 |
2 files changed, 42 insertions, 24 deletions
diff --git a/fml/lib/FML/Command/User/confirm.pm b/fml/lib/FML/Command/User/confirm.pm index 050a3d71..a5b28fee 100644 --- a/fml/lib/FML/Command/User/confirm.pm +++ b/fml/lib/FML/Command/User/confirm.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: confirm.pm,v 1.9 2002/04/06 14:46:28 fukachan Exp $ +# $FML: confirm.pm,v 1.10 2002/04/11 15:39:42 tmu Exp $ # package FML::Command::User::confirm; @@ -52,6 +52,20 @@ sub new sub need_lock { 1;} +# Descriptions: addresses to inform a message copy to +# Arguments: none +# Side Effects: none +# Return Value: ARREY_REF +sub notice_cc_recipient +{ + my ($self, $curproc, $command_args) = @_; + my $config = $curproc->{ config }; + my $maintainer = $config->{ maintainer }; + + return [ $maintainer ]; +} + + # Descriptions: execute the actual process if this confirmation succeeds. # run _switch_command() for real process. # Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) diff --git a/fml/lib/FML/Command/UserControl.pm b/fml/lib/FML/Command/UserControl.pm index e5cc9f3d..7f66d2bf 100644 --- a/fml/lib/FML/Command/UserControl.pm +++ b/fml/lib/FML/Command/UserControl.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: UserControl.pm,v 1.10 2002/07/02 03:55:54 fukachan Exp $ +# $FML: UserControl.pm,v 1.11 2002/07/14 04:13:11 fukachan Exp $ # package FML::Command::UserControl; @@ -51,27 +51,29 @@ sub new sub useradd { my ($self, $curproc, $command_args, $uc_args) = @_; - my $address = $uc_args->{ address }; - my $maplist = $uc_args->{ maplist }; + my $address = $uc_args->{ address }; + my $maplist = $uc_args->{ maplist }; + my $msg_args = $command_args->{ msg_args }; + $msg_args->{ _arg_address } = $address; for my $map (@$maplist) { my $cred = new FML::Credential; unless ($cred->has_address_in_map($map, $address)) { - my $obj = new IO::Adapter $map; + $msg_args->{ _arg_map } = $curproc->which_map_nl($map); + + my $obj = new IO::Adapter $map; $obj->touch(); # create a new map entry (e.g. file) if needed. $obj->add( $address ); unless ($obj->error()) { Log("add $address to map=$map"); - $curproc->reply_message('command.add_ok', - "$address added.", - { _arg_address => $address,} - ); + $curproc->reply_message_nl('command.add_ok', + "$address added.", + $msg_args); } else { - $curproc->reply_message('command.add_fail', - "failed to add $address", - { _arg_address => $address,} - ); + $curproc->reply_message_nl('command.add_fail', + "failed to add $address", + $msg_args); croak("fail to add $address to map=$map"); } } @@ -91,27 +93,29 @@ sub useradd sub userdel { my ($self, $curproc, $command_args, $uc_args) = @_; - my $address = $uc_args->{ address }; - my $maplist = $uc_args->{ maplist }; + my $address = $uc_args->{ address }; + my $maplist = $uc_args->{ maplist }; + my $msg_args = $command_args->{ msg_args }; + $msg_args->{ _arg_address } = $address; for my $map (@$maplist) { my $cred = new FML::Credential; if ($cred->has_address_in_map($map, $address)) { - my $obj = new IO::Adapter $map; + $msg_args->{ _arg_map } = $curproc->which_map_nl($map); + + my $obj = new IO::Adapter $map; $obj->delete( $address ); unless ($obj->error()) { Log("removed $address from map=$map"); - $curproc->reply_message('command.del_ok', - "$address added.", - { _arg_address => $address,} - ); + $curproc->reply_message_nl('command.del_ok', + "$address removed.", + $msg_args); } else { + $curproc->reply_message_nl('command.del_fail', + "failed to remove $address", + $msg_args); croak("fail to remove $address from map=$map"); - $curproc->reply_message('command.del_ok', - "$address added.", - { _arg_address => $address,} - ); } } else { |
