diff options
| author | fukachan <fukachan> | 2006-03-05 08:08:36 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2006-03-05 08:08:36 +0000 |
| commit | 6940f468f92ec8044c1982a4f7b12b4f4637a418 (patch) | |
| tree | 507b8dad59bc6b405872ddebb274cdfed52eba27 /fml/lib/FML/Command | |
| parent | 5ebcb0b781221838b47e8492d1e057b093490604 (diff) | |
| download | fml8-6940f468f92ec8044c1982a4f7b12b4f4637a418.tar.gz fml8-6940f468f92ec8044c1982a4f7b12b4f4637a418.tar.bz2 fml8-6940f468f92ec8044c1982a4f7b12b4f4637a418.zip | |
changed to command_context object based.
Diffstat (limited to 'fml/lib/FML/Command')
34 files changed, 119 insertions, 121 deletions
diff --git a/fml/lib/FML/Command/Admin/addadmin.pm b/fml/lib/FML/Command/Admin/addadmin.pm index 2fed81d6..f6d4da1c 100644 --- a/fml/lib/FML/Command/Admin/addadmin.pm +++ b/fml/lib/FML/Command/Admin/addadmin.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: addadmin.pm,v 1.22 2005/08/17 12:08:42 fukachan Exp $ +# $FML: addadmin.pm,v 1.23 2006/03/04 13:48:28 fukachan Exp $ # package FML::Command::Admin::addadmin; @@ -82,7 +82,7 @@ sub process my ($self, $curproc, $command_context) = @_; my $config = $curproc->config(); my $options = $command_context->get_options(); - my $address = $command_context->{ command_data } || $options->[ 0 ]; + my $address = $command_context->get_data() || $options->[ 0 ]; # XXX We should always add/rewrite only $primary_*_map maps via # XXX command mail, CUI and GUI. diff --git a/fml/lib/FML/Command/Admin/addmember.pm b/fml/lib/FML/Command/Admin/addmember.pm index 08bc37f8..74e6d88d 100644 --- a/fml/lib/FML/Command/Admin/addmember.pm +++ b/fml/lib/FML/Command/Admin/addmember.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: addmember.pm,v 1.6 2005/11/30 23:30:38 fukachan Exp $ +# $FML: addmember.pm,v 1.7 2006/03/04 13:48:28 fukachan Exp $ # package FML::Command::Admin::addmember; @@ -83,7 +83,7 @@ sub process my $config = $curproc->config(); my $cred = $curproc->credential(); my $options = $command_context->get_options(); - my $address = $command_context->{ command_data } || $options->[ 0 ]; + my $address = $command_context->get_data() || $options->[ 0 ]; # XXX We should always add/rewrite only $primary_*_map maps via # XXX command mail, CUI and GUI. diff --git a/fml/lib/FML/Command/Admin/addmoderator.pm b/fml/lib/FML/Command/Admin/addmoderator.pm index 9cc8bbda..9bc7db5f 100644 --- a/fml/lib/FML/Command/Admin/addmoderator.pm +++ b/fml/lib/FML/Command/Admin/addmoderator.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: addmoderator.pm,v 1.17 2005/08/17 12:08:42 fukachan Exp $ +# $FML: addmoderator.pm,v 1.18 2006/03/04 13:48:28 fukachan Exp $ # package FML::Command::Admin::addmoderator; @@ -82,7 +82,7 @@ sub process my ($self, $curproc, $command_context) = @_; my $config = $curproc->config(); my $options = $command_context->get_options(); - my $address = $command_context->{ command_data } || $options->[ 0 ]; + my $address = $command_context->get_data() || $options->[ 0 ]; # XXX We should always add/rewrite only $primary_*_map maps via # XXX command mail, CUI and GUI. diff --git a/fml/lib/FML/Command/Admin/addrecipient.pm b/fml/lib/FML/Command/Admin/addrecipient.pm index 9ebe0ae2..5e41a12e 100644 --- a/fml/lib/FML/Command/Admin/addrecipient.pm +++ b/fml/lib/FML/Command/Admin/addrecipient.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: addrecipient.pm,v 1.6 2005/11/30 23:30:38 fukachan Exp $ +# $FML: addrecipient.pm,v 1.7 2006/03/04 13:48:28 fukachan Exp $ # package FML::Command::Admin::addrecipient; @@ -83,7 +83,7 @@ sub process my $config = $curproc->config(); my $cred = $curproc->credential(); my $options = $command_context->get_options(); - my $address = $command_context->{ command_data } || $options->[ 0 ]; + my $address = $command_context->get_data() || $options->[ 0 ]; # XXX We should always add/rewrite only $primary_*_map maps via # XXX command mail, CUI and GUI. diff --git a/fml/lib/FML/Command/Admin/chaddr.pm b/fml/lib/FML/Command/Admin/chaddr.pm index dfbdd04b..c410a995 100644 --- a/fml/lib/FML/Command/Admin/chaddr.pm +++ b/fml/lib/FML/Command/Admin/chaddr.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: chaddr.pm,v 1.27 2004/06/29 10:02:42 fukachan Exp $ +# $FML: chaddr.pm,v 1.28 2006/03/04 13:48:28 fukachan Exp $ # package FML::Command::Admin::chaddr; @@ -127,11 +127,11 @@ sub process my $member_map = $config->{ 'primary_member_map' }; my $recipient_map = $config->{ 'primary_recipient_map' }; - my $old_address = ''; - my $new_address = ''; - if (defined $command_context->{ command_data }) { - my $x = $command_context->{ command_data }; - ($old_address, $new_address) = split(/\s+/, $x); + my $old_address = ''; + my $new_address = ''; + my $command_data = $command_context->get_data() || ''; + if ($command_data) { + ($old_address, $new_address) = split(/\s+/, $command_data); } else { $old_address = $options->[ 0 ]; diff --git a/fml/lib/FML/Command/Admin/deladmin.pm b/fml/lib/FML/Command/Admin/deladmin.pm index 7d148efa..e4acb825 100644 --- a/fml/lib/FML/Command/Admin/deladmin.pm +++ b/fml/lib/FML/Command/Admin/deladmin.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: deladmin.pm,v 1.21 2005/08/17 12:08:43 fukachan Exp $ +# $FML: deladmin.pm,v 1.22 2006/03/04 13:48:28 fukachan Exp $ # package FML::Command::Admin::deladmin; @@ -92,7 +92,7 @@ sub process my $member_map = $config->{ 'primary_admin_member_map' }; my $recipient_map = $config->{ 'primary_admin_recipient_map' }; my $options = $command_context->get_options(); - my $address = $command_context->{ command_data } || $options->[ 0 ]; + my $address = $command_context->get_data() || $options->[ 0 ]; # fundamental sanity check croak("address not undefined") unless defined $address; diff --git a/fml/lib/FML/Command/Admin/delmoderator.pm b/fml/lib/FML/Command/Admin/delmoderator.pm index 65042964..663f2be4 100644 --- a/fml/lib/FML/Command/Admin/delmoderator.pm +++ b/fml/lib/FML/Command/Admin/delmoderator.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: delmoderator.pm,v 1.20 2005/08/17 12:08:42 fukachan Exp $ +# $FML: delmoderator.pm,v 1.21 2006/03/04 13:48:28 fukachan Exp $ # package FML::Command::Admin::delmoderator; @@ -82,7 +82,7 @@ sub process my ($self, $curproc, $command_context) = @_; my $config = $curproc->config(); my $options = $command_context->get_options(); - my $address = $command_context->{ command_data } || $options->[ 0 ]; + my $address = $command_context->get_data() || $options->[ 0 ]; # XXX We should always add/rewrite only $primary_*_map maps via # XXX command mail, CUI and GUI. diff --git a/fml/lib/FML/Command/Admin/digest.pm b/fml/lib/FML/Command/Admin/digest.pm index a22e1df2..baa61530 100644 --- a/fml/lib/FML/Command/Admin/digest.pm +++ b/fml/lib/FML/Command/Admin/digest.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: digest.pm,v 1.25 2005/11/30 23:30:38 fukachan Exp $ +# $FML: digest.pm,v 1.26 2006/03/04 13:48:28 fukachan Exp $ # package FML::Command::Admin::digest; @@ -101,7 +101,7 @@ sub process my $digest_recipient_maps = $config->get_as_array_ref('digest_recipient_maps'); - my $address = $command_context->{ command_data } || $options->[ 0 ] || undef; + my $address = $command_context->get_data() || $options->[ 0 ] || undef; my $mode = $options->[ 1 ] || ''; # fundamental check diff --git a/fml/lib/FML/Command/Admin/digestoff.pm b/fml/lib/FML/Command/Admin/digestoff.pm index 2879ff70..73d4ecc9 100644 --- a/fml/lib/FML/Command/Admin/digestoff.pm +++ b/fml/lib/FML/Command/Admin/digestoff.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: digestoff.pm,v 1.12 2004/06/30 03:05:13 fukachan Exp $ +# $FML: digestoff.pm,v 1.13 2006/03/04 13:48:28 fukachan Exp $ # package FML::Command::Admin::digestoff; @@ -83,7 +83,7 @@ sub process { my ($self, $curproc, $command_context) = @_; my $options = $command_context->get_options() || []; - my $address = $command_context->{ command_data } || $options->[ 0 ] || undef; + my $address = $command_context->get_data() || $options->[ 0 ] || undef; # mode off $options->[ 1 ] = "off"; diff --git a/fml/lib/FML/Command/Admin/digeston.pm b/fml/lib/FML/Command/Admin/digeston.pm index df5b3a8b..01816e1b 100644 --- a/fml/lib/FML/Command/Admin/digeston.pm +++ b/fml/lib/FML/Command/Admin/digeston.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: digeston.pm,v 1.12 2004/06/30 03:05:13 fukachan Exp $ +# $FML: digeston.pm,v 1.13 2006/03/04 13:48:28 fukachan Exp $ # package FML::Command::Admin::digeston; @@ -83,7 +83,7 @@ sub process { my ($self, $curproc, $command_context) = @_; my $options = $command_context->get_options() || []; - my $address = $command_context->{ command_data } || $options->[ 0 ] || undef; + my $address = $command_context->get_data() || $options->[ 0 ] || undef; # mode on $options->[ 1 ] = "on"; diff --git a/fml/lib/FML/Command/Admin/get.pm b/fml/lib/FML/Command/Admin/get.pm index 7a01136d..50e2fcb7 100644 --- a/fml/lib/FML/Command/Admin/get.pm +++ b/fml/lib/FML/Command/Admin/get.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: get.pm,v 1.28 2005/08/17 12:08:43 fukachan Exp $ +# $FML: get.pm,v 1.29 2006/03/04 13:48:28 fukachan Exp $ # package FML::Command::Admin::get; @@ -63,7 +63,6 @@ sub process my ($self, $curproc, $command_context) = @_; my $config = $curproc->config(); my $ml_home_dir = $config->{ ml_home_dir }; - my $command = $command_context->{ command }; my $options = $command_context->get_options(); my $recipient = ''; diff --git a/fml/lib/FML/Command/Admin/moderate.pm b/fml/lib/FML/Command/Admin/moderate.pm index 9543ee3e..d9e24232 100644 --- a/fml/lib/FML/Command/Admin/moderate.pm +++ b/fml/lib/FML/Command/Admin/moderate.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: moderate.pm,v 1.1 2005/12/18 12:03:17 fukachan Exp $ +# $FML: moderate.pm,v 1.2 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::Admin::moderate; @@ -76,7 +76,7 @@ sub process my ($self, $curproc, $command_context) = @_; my $config = $curproc->config(); my $options = $command_context->get_options() || []; - my $address = $command_context->{ command_data } || $options->[ 0 ]; + my $address = $command_context->get_data() || $options->[ 0 ]; my $confirm_id = $command_context->{ _confirm_id } || undef; use FML::Confirm; diff --git a/fml/lib/FML/Command/Admin/newdomain.pm b/fml/lib/FML/Command/Admin/newdomain.pm index 2327a776..e242199c 100644 --- a/fml/lib/FML/Command/Admin/newdomain.pm +++ b/fml/lib/FML/Command/Admin/newdomain.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: newdomain.pm,v 1.8 2004/07/23 13:16:35 fukachan Exp $ +# $FML: newdomain.pm,v 1.9 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::Admin::newdomain; @@ -55,7 +55,7 @@ sub need_lock { 0;} sub process { my ($self, $curproc, $command_context) = @_; - my $canon_argv = $command_context->{ canon_argv }; + my $canon_argv = $command_context->get_canon_argv(); my $domain = $canon_argv->{ ml_name }; my $prefix = $canon_argv->{ options }->[ 0 ]; my $error = ''; diff --git a/fml/lib/FML/Command/Admin/newml.pm b/fml/lib/FML/Command/Admin/newml.pm index 78e4877a..c517256d 100644 --- a/fml/lib/FML/Command/Admin/newml.pm +++ b/fml/lib/FML/Command/Admin/newml.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: newml.pm,v 1.82 2006/02/04 08:10:08 fukachan Exp $ +# $FML: newml.pm,v 1.83 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::Admin::newml; @@ -68,8 +68,8 @@ sub process my ($self, $curproc, $command_context) = @_; my $options = $curproc->command_line_options(); my $config = $curproc->config(); - my $ml_name = $command_context->{ ml_name }; - my $ml_domain = $command_context->{ ml_domain }; + my $ml_name = $command_context->get_ml_name(); + my $ml_domain = $command_context->get_ml_domain(); my $ml_home_prefix = $curproc->ml_home_prefix($ml_domain); my $ml_home_dir = $curproc->ml_home_dir($ml_name, $ml_domain); my $owner = $config->{ newml_command_ml_admin_default_address }|| diff --git a/fml/lib/FML/Command/Admin/off.pm b/fml/lib/FML/Command/Admin/off.pm index 7cacf9b1..05c6418b 100644 --- a/fml/lib/FML/Command/Admin/off.pm +++ b/fml/lib/FML/Command/Admin/off.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: off.pm,v 1.24 2005/11/30 23:30:38 fukachan Exp $ +# $FML: off.pm,v 1.25 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::Admin::off; @@ -83,7 +83,7 @@ sub process my $config = $curproc->config(); my $cred = $curproc->credential(); my $options = $command_context->get_options() || []; - my $address = $command_context->{ command_data } || $options->[ 0 ]; + my $address = $command_context->get_data() || $options->[ 0 ]; # XXX We should always add/rewrite only $primary_*_map maps via # XXX command mail, CUI and GUI. diff --git a/fml/lib/FML/Command/Admin/on.pm b/fml/lib/FML/Command/Admin/on.pm index eeed767a..6fa758b0 100644 --- a/fml/lib/FML/Command/Admin/on.pm +++ b/fml/lib/FML/Command/Admin/on.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: on.pm,v 1.24 2005/11/30 23:30:38 fukachan Exp $ +# $FML: on.pm,v 1.25 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::Admin::on; @@ -83,7 +83,7 @@ sub process my $config = $curproc->config(); my $cred = $curproc->credential(); my $options = $command_context->get_options() || []; - my $address = $command_context->{ command_data } || $options->[ 0 ] || ''; + my $address = $command_context->get_data() || $options->[ 0 ] || ''; # XXX We should always add/rewrite only $primary_*_map maps via # XXX command mail, CUI and GUI. diff --git a/fml/lib/FML/Command/Admin/rmdomain.pm b/fml/lib/FML/Command/Admin/rmdomain.pm index 76350eef..a6f17809 100644 --- a/fml/lib/FML/Command/Admin/rmdomain.pm +++ b/fml/lib/FML/Command/Admin/rmdomain.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: rmdomain.pm,v 1.7 2004/07/26 01:10:54 fukachan Exp $ +# $FML: rmdomain.pm,v 1.8 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::Admin::rmdomain; @@ -55,7 +55,7 @@ sub need_lock { 0;} sub process { my ($self, $curproc, $command_context) = @_; - my $canon_argv = $command_context->{ canon_argv }; + my $canon_argv = $command_context->get_canon_argv(); my $domain = $canon_argv->{ ml_name }; if ($domain) { diff --git a/fml/lib/FML/Command/Admin/rmml.pm b/fml/lib/FML/Command/Admin/rmml.pm index 7c1fb13d..855840a3 100644 --- a/fml/lib/FML/Command/Admin/rmml.pm +++ b/fml/lib/FML/Command/Admin/rmml.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: rmml.pm,v 1.29 2006/02/15 13:44:03 fukachan Exp $ +# $FML: rmml.pm,v 1.30 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::Admin::rmml; @@ -68,8 +68,8 @@ sub process my ($self, $curproc, $command_context) = @_; my $options = $curproc->command_line_options(); my $config = $curproc->config(); - my $ml_name = $command_context->{ ml_name }; - my $ml_domain = $command_context->{ ml_domain }; + my $ml_name = $command_context->get_ml_name(); + my $ml_domain = $command_context->get_ml_domain(); my $ml_home_prefix = $curproc->ml_home_prefix($ml_domain); my $ml_home_dir = $curproc->ml_home_dir($ml_name, $ml_domain); my $params = { diff --git a/fml/lib/FML/Command/Admin/subscribe.pm b/fml/lib/FML/Command/Admin/subscribe.pm index 51ecd1a6..2583ea15 100644 --- a/fml/lib/FML/Command/Admin/subscribe.pm +++ b/fml/lib/FML/Command/Admin/subscribe.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: subscribe.pm,v 1.34 2005/08/17 12:08:44 fukachan Exp $ +# $FML: subscribe.pm,v 1.35 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::Admin::subscribe; @@ -84,7 +84,7 @@ sub process my ($self, $curproc, $command_context) = @_; my $config = $curproc->config(); my $options = $command_context->get_options() || []; - my $address = $command_context->{ command_data } || $options->[ 0 ]; + my $address = $command_context->get_data() || $options->[ 0 ]; # XXX We should always add/rewrite only $primary_*_map maps via # XXX command mail, CUI and GUI. diff --git a/fml/lib/FML/Command/Admin/unsubscribe.pm b/fml/lib/FML/Command/Admin/unsubscribe.pm index 134f406a..7a9afd91 100644 --- a/fml/lib/FML/Command/Admin/unsubscribe.pm +++ b/fml/lib/FML/Command/Admin/unsubscribe.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: unsubscribe.pm,v 1.35 2005/08/17 12:08:44 fukachan Exp $ +# $FML: unsubscribe.pm,v 1.36 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::Admin::unsubscribe; @@ -84,7 +84,7 @@ sub process my ($self, $curproc, $command_context) = @_; my $config = $curproc->config(); my $options = $command_context->get_options() || []; - my $address = $command_context->{ command_data } || $options->[ 0 ]; + my $address = $command_context->get_data() || $options->[ 0 ]; # XXX We should always add/rewrite only $primary_*_map maps via # XXX command mail, CUI and GUI. diff --git a/fml/lib/FML/Command/Auth.pm b/fml/lib/FML/Command/Auth.pm index f0182730..733b902c 100644 --- a/fml/lib/FML/Command/Auth.pm +++ b/fml/lib/FML/Command/Auth.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: Auth.pm,v 1.40 2005/05/26 09:46:01 fukachan Exp $ +# $FML: Auth.pm,v 1.41 2005/11/30 23:30:38 fukachan Exp $ # package FML::Command::Auth; @@ -226,7 +226,7 @@ sub check_admin_member_password } -=head2 change_password($curproc, $command_args, $up_args) +=head2 change_password($curproc, $command_context, $up_args) $up_args = { maplist => $maps, @@ -239,12 +239,12 @@ sub check_admin_member_password # Descriptions: change password. # Arguments: OBJ($self) -# OBJ($curproc) HASH_REF($command_args) HASH_REF($up_args) +# OBJ($curproc) OBJ($command_context) HASH_REF($up_args) # Side Effects: admin password modified. # Return Value: NUM(1 if success, 0 if fail) sub change_password { - my ($self, $curproc, $command_args, $up_args) = @_; + my ($self, $curproc, $command_context, $up_args) = @_; my $cred = $curproc->credential(); my $map = $up_args->{ map }; my $address = $up_args->{ address }; diff --git a/fml/lib/FML/Command/DirUtils.pm b/fml/lib/FML/Command/DirUtils.pm index 96adbbb2..59ebd78d 100644 --- a/fml/lib/FML/Command/DirUtils.pm +++ b/fml/lib/FML/Command/DirUtils.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: DirUtils.pm,v 1.20 2004/07/23 15:59:03 fukachan Exp $ +# $FML: DirUtils.pm,v 1.21 2005/05/26 09:55:36 fukachan Exp $ # package FML::Command::DirUtils; @@ -52,12 +52,12 @@ sub new # Descriptions: show the result by executing "ls". # Arguments: OBJ($self) -# OBJ($curproc) HASH_REF($command_args) HASH_REF($du_args) +# OBJ($curproc) OBJ($command_context) HASH_REF($du_args) # Side Effects: none # Return Value: none sub dir { - my ($self, $curproc, $command_args, $du_args) = @_; + my ($self, $curproc, $command_context, $du_args) = @_; my $config = $curproc->config(); my $path_ls = $config->{ path_ls }; my $argv = $du_args->{ argv }; @@ -65,7 +65,7 @@ sub dir my $rm_args = {}; # inherit reply_message information. - my $recipient = $command_args->{ recipient } || ''; + my $recipient = $command_context->{ recipient } || ''; if ($recipient) { $rm_args->{ recipient } = $recipient;} # option: permit "ls [-A-Za-z]" syntax diff --git a/fml/lib/FML/Command/FileUtils.pm b/fml/lib/FML/Command/FileUtils.pm index ffae0c51..b06150c1 100644 --- a/fml/lib/FML/Command/FileUtils.pm +++ b/fml/lib/FML/Command/FileUtils.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: FileUtils.pm,v 1.17 2004/04/23 04:10:30 fukachan Exp $ +# $FML: FileUtils.pm,v 1.18 2004/07/23 13:16:34 fukachan Exp $ # package FML::Command::FileUtils; @@ -47,11 +47,11 @@ sub new } -=head2 delete($curproc, $command_args, $du_aregs) +=head2 delete($curproc, $command_context, $du_aregs) same as remove() below. -=head2 remove($curproc, $command_args, $du_aregs) +=head2 remove($curproc, $command_context, $du_aregs) remove files specified in $du_args->{ options } if the file exsits and the file name matches safe file regexp defined @@ -73,12 +73,12 @@ sub delete # Descriptions: remove files. # Arguments: OBJ($self) -# OBJ($curproc) HASH_REF($command_args) HASH_REF($du_args) +# OBJ($curproc) OBJ($command_context) HASH_REF($du_args) # Side Effects: none # Return Value: none sub remove { - my ($self, $curproc, $command_args, $du_args) = @_; + my ($self, $curproc, $command_context, $du_args) = @_; my $config = $curproc->config(); my $argv = $du_args->{ options }; my $is_error = 0; diff --git a/fml/lib/FML/Command/Message.pm b/fml/lib/FML/Command/Message.pm index 32bff683..174a508e 100644 --- a/fml/lib/FML/Command/Message.pm +++ b/fml/lib/FML/Command/Message.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: Message.pm,v 1.1 2006/01/07 14:43:25 fukachan Exp $ +# $FML: Message.pm,v 1.2 2006/01/09 14:00:53 fukachan Exp $ # package FML::Command::Message; @@ -42,7 +42,7 @@ sub new } -=head2 send_confirmation($curproc, $command_args, $confirm, $sc_args) +=head2 send_confirmation($curproc, $command_context, $confirm, $sc_args) send back confirmation message. @@ -57,13 +57,13 @@ send back confirmation message. # Descriptions: send back confirmation message. -# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) +# Arguments: OBJ($self) OBJ($curproc) OBJ($command_context) # OBJ($confirm) HASH_REF($sc_args) # Side Effects: messages sent. # Return Value: none sub send_confirmation { - my ($self, $curproc, $command_args, $confirm, $sc_args) = @_; + my ($self, $curproc, $command_context, $confirm, $sc_args) = @_; my $config = $curproc->config(); my $id = $confirm->assign_id; my $command = $sc_args->{ command } || ""; diff --git a/fml/lib/FML/Command/SendFile.pm b/fml/lib/FML/Command/SendFile.pm index 532b737d..5b25f06f 100644 --- a/fml/lib/FML/Command/SendFile.pm +++ b/fml/lib/FML/Command/SendFile.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: SendFile.pm,v 1.45 2005/08/11 04:11:27 fukachan Exp $ +# $FML: SendFile.pm,v 1.46 2005/08/17 10:33:17 fukachan Exp $ # package FML::Command::SendFile; @@ -27,8 +27,8 @@ L<FML::Command::Admin::get> on the usage detail. sub process { - my ($self, $curproc, $command_args) = @_; - $self->send_article($curproc, $command_args); + my ($self, $curproc, $command_context) = @_; + $self->send_article($curproc, $command_context); } =head1 DESCRIPTION @@ -38,7 +38,7 @@ and file(s) in C<$ml_home_dir>. =head1 METHODS -=head2 send_article($curproc, $command_args) +=head2 send_article($curproc, $command_context) send back articles where C<article> is a file named as /^\d+$/ in the ml spool $spool_dir. This is used in C<FML::Command::User> and @@ -47,14 +47,14 @@ C<FML::Command::Admin> modules. =cut -# Descriptions: return the number of files specified in $command_args. -# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) +# Descriptions: return the number of files specified in $command_context. +# Arguments: OBJ($self) OBJ($curproc) OBJ($command_context) # Side Effects: none # Return Value: NUM sub num_files_in_send_article_args { - my ($self, $curproc, $command_args) = @_; - my $command = $command_args->{ command }; + my ($self, $curproc, $command_context) = @_; + my $command = $command_context->get_clean_command(); my $count = 0; # command buffer = get 1 @@ -74,14 +74,14 @@ sub num_files_in_send_article_args # Descriptions: send back articles. -# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) +# Arguments: OBJ($self) OBJ($curproc) OBJ($command_context) # Side Effects: none # Return Value: none sub send_article { - my ($self, $curproc, $command_args) = @_; - my $command = $command_args->{ command }; - my $recipient = $command_args->{ _recipient } || ''; + my ($self, $curproc, $command_context) = @_; + my $command = $command_context->get_clean_command(); + my $recipient = $command_context->{ _recipient } || ''; my $config = $curproc->config(); my $ml_name = $config->{ ml_name }; my $spool_dir = $config->{ spool_dir }; @@ -160,24 +160,24 @@ sub _get_valid_article_list } -=head2 send_file($curproc, $command_args) +=head2 send_file($curproc, $command_context) -send back file specified as C<$command_args->{ _filepath_to_send }>. +send back file specified as C<$command_context->{ _filepath_to_send }>. =cut # Descriptions: send arbitrary file in $ml_home_dir. # XXX we permit arbitrary file for admin to get. -# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) +# Arguments: OBJ($self) OBJ($curproc) OBJ($command_context) # Side Effects: none # Return Value: none sub send_file { - my ($self, $curproc, $command_args) = @_; - my $filename = $command_args->{ _filename_to_send }; - my $filepath = $command_args->{ _filepath_to_send }; - my $recipient = $command_args->{ _recipient } || ''; + my ($self, $curproc, $command_context) = @_; + my $filename = $command_context->{ _filename_to_send }; + my $filepath = $command_context->{ _filepath_to_send }; + my $recipient = $command_context->{ _recipient } || ''; my $config = $curproc->config(); # XXX langinfo_get_charset() take Accpet-Language: header field into account. @@ -212,7 +212,7 @@ sub send_file } -=head2 send_user_xxx_message($curproc, $command_args, $type) +=head2 send_user_xxx_message($curproc, $command_context, $type) Send back a help file if "help" is found in $ml_home_dir (e.g. /var/spool/ml/elena) for backward compatibility. @@ -223,12 +223,12 @@ Sebd back the default help message if not found. # Descriptions: send back file file in $ml_home_dir if found. # return the default message if not found. -# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) STR($type) +# Arguments: OBJ($self) OBJ($curproc) OBJ($command_context) STR($type) # Side Effects: put the message into the mail queue # Return Value: none sub send_user_xxx_message { - my ($self, $curproc, $command_args, $type) = @_; + my ($self, $curproc, $command_context, $type) = @_; my $config = $curproc->config(); # XXX-TODO: care for non Japanese @@ -236,9 +236,9 @@ sub send_user_xxx_message # if "help" is found in $ml_home_dir (e.g. /var/spool/ml/elena), # send it. if (-f $config->{ "${type}_file" }) { - $command_args->{ _filepath_to_send } = $config->{ "${type}_file" }; - $command_args->{ _filename_to_send } = $type; - $self->send_file($curproc, $command_args); + $command_context->{ _filepath_to_send } = $config->{ "${type}_file" }; + $command_context->{ _filename_to_send } = $type; + $self->send_file($curproc, $command_context); } # if "help" is not found, use the default help message. else { diff --git a/fml/lib/FML/Command/Syntax.pm b/fml/lib/FML/Command/Syntax.pm index 97d2eb4c..bcd048b0 100644 --- a/fml/lib/FML/Command/Syntax.pm +++ b/fml/lib/FML/Command/Syntax.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: Syntax.pm,v 1.1 2004/04/28 04:10:35 fukachan Exp $ +# $FML: Syntax.pm,v 1.2 2004/06/26 11:34:34 fukachan Exp $ # package FML::Command::Syntax; @@ -22,7 +22,7 @@ FML::Command::Syntax - common command syntax checker. =head1 METHODS -=head2 check_syntax_address_handler($curproc, $command_args) +=head2 check_syntax_address_handler($curproc, $command_context) verify the syntax command string. return 0 if it looks insecure. @@ -31,15 +31,15 @@ return 0 if it looks insecure. # Descriptions: verify the syntax command string. -# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) +# Arguments: OBJ($self) OBJ($curproc) OBJ($command_context) # Side Effects: none # Return Value: NUM(1 or 0) sub check_syntax_address_handler { - my ($self, $curproc, $command_args) = @_; - my $comname = $command_args->{ comname } || ''; - my $comsubname = $command_args->{ comsubname } || ''; - my $options = $command_args->{ options } || []; + my ($self, $curproc, $command_context) = @_; + my $comname = $command_context->get_cooked_command() || ''; + my $comsubname = $command_context->get_cooked_subcommand() || ''; + my $options = $command_context->get_options() || []; my (@test) = ($comname); my $ok = 0; @@ -64,7 +64,7 @@ sub check_syntax_address_handler # 2. check other comonents use FML::Command; my $dispatch = new FML::Command; - if ($dispatch->safe_regexp_match($curproc, $command_args, \@test)) { + if ($dispatch->safe_regexp_match($curproc, $command_context, \@test)) { $ok++; } else { diff --git a/fml/lib/FML/Command/User/admin.pm b/fml/lib/FML/Command/User/admin.pm index 56b77bdf..cd171b27 100644 --- a/fml/lib/FML/Command/User/admin.pm +++ b/fml/lib/FML/Command/User/admin.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: admin.pm,v 1.15 2006/03/04 12:56:58 fukachan Exp $ +# $FML: admin.pm,v 1.16 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::User::admin; @@ -136,7 +136,7 @@ sub process else { my $class = $command_context->get_cooked_subcommand() || ''; my $c = "admin $class ..."; - my $masked_command = $command_context->{ masked_original_command } || $c; + my $masked_command = $command_context->get_masked_command() || $c; $curproc->logerror("admin: not auth, cannot run \"$masked_command\""); $curproc->reply_message_nl("command.admin_auth_fail", "not authenticated."); @@ -285,7 +285,7 @@ sub _apply_new_admin_command_mail_restrictions sub _execute_admin_command { my ($self, $curproc, $command_context, $class) = @_; - my $args = $self->_prepare_command_args($curproc, $command_context); + my $args = $self->_prepare_command_context($curproc, $command_context); use FML::Command; my $dispatch = new FML::Command; @@ -297,7 +297,7 @@ sub _execute_admin_command # Arguments: OBJ($self) OBJ($curproc) OBJ($command_context) # Side Effects: none # Return Value: none -sub _prepare_command_args +sub _prepare_command_context { my ($self, $curproc, $command_context) = @_; diff --git a/fml/lib/FML/Command/User/chaddr.pm b/fml/lib/FML/Command/User/chaddr.pm index 895703d4..01d19314 100644 --- a/fml/lib/FML/Command/User/chaddr.pm +++ b/fml/lib/FML/Command/User/chaddr.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: chaddr.pm,v 1.37 2006/01/09 14:00:54 fukachan Exp $ +# $FML: chaddr.pm,v 1.38 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::User::chaddr; @@ -133,7 +133,7 @@ sub process my $cache_dir = $config->{ db_dir }; my $keyword = $config->{ confirm_command_prefix }; my $comname = $command_context->get_cooked_command(); - my $command = $command_context->{ command }; + my $command = $command_context->get_clean_command(); my $sender = $cred->sender(); # cheap sanity checks @@ -146,7 +146,7 @@ sub process # addresses we check and send back confirmation messages to my $optargs = {}; - my $x = $command_context->{ command }; + my $x = $command_context->get_clean_command(); $x =~ s/^.*$comname\s+//; my ($old_addr, $new_addr) = split(/\s+/, $x); $optargs->{ recipient } = [ $sender, $old_addr, $new_addr ]; diff --git a/fml/lib/FML/Command/User/confirm.pm b/fml/lib/FML/Command/User/confirm.pm index 420cf124..96e6b2aa 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.38 2006/01/09 14:00:54 fukachan Exp $ +# $FML: confirm.pm,v 1.39 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::User::confirm; @@ -95,7 +95,7 @@ sub process my $cache_dir = $config->{ db_dir }; my $keyword = $config->{ confirm_command_prefix }; my $expire_limit = $config->{ confirm_expire_limit } || 14*24*3600; - my $command = $command_context->{ command }; + my $command = $command_context->get_clean_command(); # XXX-TODO: sanity @@ -215,9 +215,9 @@ sub _switch_command $class eq 'on' || $class eq 'off' || $class eq 'moderate') { - $command_context->{ command_data } = $address; - $command_context->{ command_mode } = 'Admin'; - $command_context->{ override_need_no_lock } = 1; # already locked + $command_context->set_data($address); + $command_context->set_mode("Admin"); + $command_context->set_need_lock("no"); $obj->$class($curproc, $command_context); } else { diff --git a/fml/lib/FML/Command/User/digest.pm b/fml/lib/FML/Command/User/digest.pm index 584b4c4c..5cffdde7 100644 --- a/fml/lib/FML/Command/User/digest.pm +++ b/fml/lib/FML/Command/User/digest.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: digest.pm,v 1.17 2005/12/16 13:15:23 fukachan Exp $ +# $FML: digest.pm,v 1.18 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::User::digest; @@ -81,7 +81,7 @@ sub process my $recipient_map = $config->{ primary_recipient_map }; my $cache_dir = $config->{ db_dir }; my $keyword = $config->{ confirm_command_prefix }; - my $command = $command_context->{ command }; + my $command = $command_context->get_clean_command(); my $address = $cred->sender(); my $mode = ''; @@ -107,9 +107,8 @@ sub process $curproc->log("digest $mode"); # emulate options ARRAY_REF. - $command_context->{ command_data } = $address; - $command_context->get_options()->[0] = $address; - $command_context->get_options()->[1] = $mode; + $command_context->set_data($address); + $command_context->set_options( [ $address, $mode ] ); # XXX-TODO: direct call of Admin::digest is correct? # XXX-TODO: confirmation ? diff --git a/fml/lib/FML/Command/User/off.pm b/fml/lib/FML/Command/User/off.pm index f45753f2..208e4525 100644 --- a/fml/lib/FML/Command/User/off.pm +++ b/fml/lib/FML/Command/User/off.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: off.pm,v 1.20 2005/11/30 23:34:45 fukachan Exp $ +# $FML: off.pm,v 1.21 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::User::off; @@ -83,7 +83,7 @@ sub process my $recipient_map = $config->{ primary_recipient_map }; my $cache_dir = $config->{ db_dir }; my $keyword = $config->{ confirm_command_prefix }; - my $command = $command_context->{ command }; + my $command = $command_context->get_clean_command(); my $address = $cred->sender(); # cheap sanity checks diff --git a/fml/lib/FML/Command/User/on.pm b/fml/lib/FML/Command/User/on.pm index 2e9df071..79d3d456 100644 --- a/fml/lib/FML/Command/User/on.pm +++ b/fml/lib/FML/Command/User/on.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: on.pm,v 1.20 2005/11/30 23:34:45 fukachan Exp $ +# $FML: on.pm,v 1.21 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::User::on; @@ -83,7 +83,7 @@ sub process my $recipient_map = $config->{ primary_recipient_map }; my $cache_dir = $config->{ db_dir }; my $keyword = $config->{ confirm_command_prefix }; - my $command = $command_context->{ command }; + my $command = $command_context->get_clean_command(); my $address = $cred->sender(); # fundamental check diff --git a/fml/lib/FML/Command/User/subscribe.pm b/fml/lib/FML/Command/User/subscribe.pm index f663010b..e69b781f 100644 --- a/fml/lib/FML/Command/User/subscribe.pm +++ b/fml/lib/FML/Command/User/subscribe.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: subscribe.pm,v 1.36 2006/01/08 03:06:59 fukachan Exp $ +# $FML: subscribe.pm,v 1.37 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::User::subscribe; @@ -83,7 +83,7 @@ sub process my $recipient_map = $config->{ primary_recipient_map }; my $cache_dir = $config->{ db_dir }; my $keyword = $config->{ confirm_command_prefix }; - my $command = $command_context->{ command }; + my $command = $command_context->get_clean_command(); my $options = $command_context->get_options(); my $cui_options = $curproc->command_line_cui_specific_options() || {}; my $address = $cui_options->{ 'send-to' } || $cred->sender(); diff --git a/fml/lib/FML/Command/User/unsubscribe.pm b/fml/lib/FML/Command/User/unsubscribe.pm index 87e1a045..bd8cf794 100644 --- a/fml/lib/FML/Command/User/unsubscribe.pm +++ b/fml/lib/FML/Command/User/unsubscribe.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: unsubscribe.pm,v 1.37 2006/01/08 03:06:59 fukachan Exp $ +# $FML: unsubscribe.pm,v 1.38 2006/03/04 13:48:29 fukachan Exp $ # package FML::Command::User::unsubscribe; @@ -82,7 +82,7 @@ sub process my $recipient_map = $config->{ primary_recipient_map }; my $cache_dir = $config->{ db_dir }; my $keyword = $config->{ confirm_command_prefix }; - my $command = $command_context->{ command }; + my $command = $command_context->get_clean_command(); my $options = $command_context->get_options(); my $cui_options = $curproc->command_line_cui_specific_options() || {}; my $address = $cui_options->{ 'send-to' } || $cred->sender(); |
