summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Command
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-06-25 03:53:31 +0000
committerfukachan <fukachan>2002-06-25 03:53:31 +0000
commit6619cc9f436b79602cdc337e3ab7a7126f26da37 (patch)
tree81f11fda75421cd43fe1603b3f147a3dc3887e9c /fml/lib/FML/Command
parenta4dd57eb2f8483a002fed944f0c87eac7817b426 (diff)
downloadfml8-6619cc9f436b79602cdc337e3ab7a7126f26da37.tar.gz
fml8-6619cc9f436b79602cdc337e3ab7a7126f26da37.tar.bz2
fml8-6619cc9f436b79602cdc337e3ab7a7126f26da37.zip
fixed to work on cgi
Diffstat (limited to 'fml/lib/FML/Command')
-rw-r--r--fml/lib/FML/Command/Admin/list.pm70
1 files changed, 62 insertions, 8 deletions
diff --git a/fml/lib/FML/Command/Admin/list.pm b/fml/lib/FML/Command/Admin/list.pm
index 31925d1e..6a259d69 100644
--- a/fml/lib/FML/Command/Admin/list.pm
+++ b/fml/lib/FML/Command/Admin/list.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: list.pm,v 1.3 2002/04/01 23:41:11 fukachan Exp $
+# $FML: list.pm,v 1.4 2002/04/07 05:01:33 fukachan Exp $
#
package FML::Command::Admin::list;
@@ -56,28 +56,55 @@ sub need_lock { 0;}
sub process
{
my ($self, $curproc, $command_args) = @_;
- my $config = $curproc->{ config };
- my $member_maps = $config->get_as_array_ref( 'member_maps' );
- my $recipient_maps = $config->get_as_array_ref( 'recipient_maps' );
- my $options = $command_args->{ options };
- my $maplist = $member_maps;
+ my $options = [ 'member' ];
+
+ # import makefml options
+ if (defined $command_args->{ options } &&
+ ref($command_args->{ options }) eq 'ARRAY') {
+ my $xopt = $command_args->{ options };
+ if (@$xopt) { $options = $xopt;}
+ }
+
+ $command_args->{ is_cgi } = 0;
+ $self->_show_list($curproc, $command_args, $options);
+}
+
+
+# Descriptions: show the address list
+# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args)
+# HASH_ARRAY($options)
+# Side Effects: none
+# Return Value: none
+sub _show_list
+{
+ my ($self, $curproc, $command_args, $options) = @_;
+ my $config = $curproc->{ config };
+ my $maplist = undef;
for (@$options) {
if (/^recipient|active/i) {
- $maplist = $recipient_maps;
+ $maplist = $config->get_as_array_ref( 'recipient_maps' );
}
elsif (/^member/i) {
- $maplist = $member_maps;
+ $maplist = $config->get_as_array_ref( 'member_maps' );
+ }
+ elsif (/^adminmember|^admin_member/i) {
+ $maplist = $config->get_as_array_ref( 'admin_member_maps' );
}
else {
LogWarn("list: unknown type $_");
}
}
+ # cheap sanity
+ unless (defined $maplist) { croak("list: map undeflined");}
+ unless ($maplist) { croak("list: map undeflined");}
+
# FML::Command::UserControl specific parameters
my $uc_args = {
maplist => $maplist,
wh => \*STDOUT,
+ is_cgi => $command_args->{ is_cgi },
};
my $r = '';
@@ -92,6 +119,33 @@ sub process
}
+# Descriptions: show cgi menu for subscribe
+# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args)
+# Side Effects: update $member_map $recipient_map
+# Return Value: none
+sub cgi_menu
+{
+ my ($self, $curproc, $args, $command_args) = @_;
+ my $options = [ 'member' ];
+ my $r = '';
+
+ # navigation bar
+ print "<p> \"@$options\" address list\n";
+ print "<hr>\n";
+
+ # declare CGI mode
+ $command_args->{ is_cgi } = 1;
+
+ eval q{
+ $self->_show_list($curproc, $command_args, $options);
+ };
+ if ($r = $@) {
+ print $r;
+ croak($r);
+ }
+}
+
+
=head1 AUTHOR
Ken'ichi Fukamachi