summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-04-01 12:40:54 +0000
committerfukachan <fukachan>2002-04-01 12:40:54 +0000
commitbed92f10af224b57190a3e0e03567260d0de32d5 (patch)
tree09894e046371b402f84d3ef9a80c67a38824ec59
parent621a422fe411786c18c0a20451ef50b94a1d6237 (diff)
downloadfml8-bed92f10af224b57190a3e0e03567260d0de32d5.tar.gz
fml8-bed92f10af224b57190a3e0e03567260d0de32d5.tar.bz2
fml8-bed92f10af224b57190a3e0e03567260d0de32d5.zip
enable "admin list" command
-rw-r--r--fml/etc/default_config.cf.ja.in1
-rw-r--r--fml/etc/src/config.cf.ja/command.cf1
-rw-r--r--fml/lib/FML/Command/Admin/list.pm94
-rw-r--r--fml/lib/FML/Command/UserControl.pm29
4 files changed, 124 insertions, 1 deletions
diff --git a/fml/etc/default_config.cf.ja.in b/fml/etc/default_config.cf.ja.in
index 2dc2e63c..dad8b843 100644
--- a/fml/etc/default_config.cf.ja.in
+++ b/fml/etc/default_config.cf.ja.in
@@ -674,6 +674,7 @@ available_commands_for_privileged_user = subscribe
dir
ls
file
+ list
available_commands_for_admin_cgi = subscribe
diff --git a/fml/etc/src/config.cf.ja/command.cf b/fml/etc/src/config.cf.ja/command.cf
index 9612aa33..dd6a92b7 100644
--- a/fml/etc/src/config.cf.ja/command.cf
+++ b/fml/etc/src/config.cf.ja/command.cf
@@ -84,6 +84,7 @@ available_commands_for_privileged_user = subscribe
dir
ls
file
+ list
available_commands_for_admin_cgi = subscribe
diff --git a/fml/lib/FML/Command/Admin/list.pm b/fml/lib/FML/Command/Admin/list.pm
new file mode 100644
index 00000000..e69b0da6
--- /dev/null
+++ b/fml/lib/FML/Command/Admin/list.pm
@@ -0,0 +1,94 @@
+#-*- perl -*-
+#
+# Copyright (C) 2002 Ken'ichi Fukamachi
+# 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.1 2002/03/24 11:26:46 fukachan Exp $
+#
+
+package FML::Command::Admin::list;
+use strict;
+use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
+use Carp;
+
+
+# Descriptions: standard constructor
+# Arguments: OBJ($self)
+# Side Effects: none
+# Return Value: OBJ
+sub new
+{
+ my ($self) = @_;
+ my ($type) = ref($self) || $self;
+ my $me = {};
+ return bless $me, $type;
+}
+
+
+# Descriptions: need lock or not
+# Arguments: none
+# Side Effects: none
+# Return Value: NUM( 1 or 0)
+sub need_lock { 0;}
+
+
+# Descriptions: dir
+# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args)
+# Side Effects: forward request to dir module
+# Return Value: none
+sub process
+{
+ my ($self, $curproc, $command_args) = @_;
+ my $config = $curproc->{ config };
+ my $member_map = $config->{ primary_member_map };
+
+ # FML::Command::UserControl specific parameters
+ my $uc_args = {
+ maplist => [ $member_map ],
+ wh => \*STDOUT,
+ };
+ my $r = '';
+
+ eval q{
+ use FML::Command::UserControl;
+ my $obj = new FML::Command::UserControl;
+ $obj->userlist($curproc, $command_args, $uc_args);
+ };
+ if ($r = $@) {
+ croak($r);
+ }
+}
+
+=head1 NAME
+
+FML::Command::Admin::list - list a new member
+
+=head1 SYNOPSIS
+
+See C<FML::Command> for more detailist.
+
+=head1 DESCRIPTION
+
+same as C<dir>.
+
+=head1 AUTHOR
+
+Ken'ichi Fukamachi
+
+=head1 COPYRIGHT
+
+Copyright (C) 2002 Ken'ichi Fukamachi
+
+All rights reserved. This program is free software; you can
+redistribute it and/or modify it under the same terms as Perl itself.
+
+=head1 HISTORY
+
+FML::Command::Admin::list appeared in fml5 mailing list driver package.
+See C<http://www.fml.org/> for more detailist.
+
+=cut
+
+
+1;
diff --git a/fml/lib/FML/Command/UserControl.pm b/fml/lib/FML/Command/UserControl.pm
index 1d88e518..734ac1a9 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.1 2002/03/19 10:12:44 fukachan Exp $
+# $FML: UserControl.pm,v 1.2 2002/03/30 11:08:34 fukachan Exp $
#
package FML::Command::UserControl;
@@ -106,6 +106,33 @@ sub userdel
}
+# Descriptions: show list
+# Arguments: OBJ($self)
+# HASH_REF($curproc) HASH_REF($command_args) HASH_REF($uc_args)
+# Side Effects: none
+# Return Value: none
+sub userlist
+{
+ my ($self, $curproc, $command_args, $uc_args) = @_;
+ my $maplist = $uc_args->{ maplist };
+ my $wh = $uc_args->{ wh };
+
+ for my $map (@$maplist) {
+ my $obj = new IO::Adapter $map;
+
+ if (defined $obj) {
+ my $x = '';
+ $obj->open || croak("cannot open $map");
+ while ($x = $obj->getline()) { print $wh $x; }
+ $obj->close;
+ }
+ else {
+ LogWarn("canot open $map");
+ }
+ }
+}
+
+
=head1 AUTHOR
Ken'ichi Fukamachi