summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-03-19 10:31:51 +0000
committerfukachan <fukachan>2002-03-19 10:31:51 +0000
commit9b8f0b4b50eaf2a54379e7cbae7270e09a2e8aa5 (patch)
tree5b3228acad7864d0af4e6f21dc3d328664dafa66
parent31c70b1e3cd0d7f800386fc61bbf6ac552fec24b (diff)
downloadfml8-9b8f0b4b50eaf2a54379e7cbae7270e09a2e8aa5.tar.gz
fml8-9b8f0b4b50eaf2a54379e7cbae7270e09a2e8aa5.tar.bz2
fml8-9b8f0b4b50eaf2a54379e7cbae7270e09a2e8aa5.zip
implement addadmin,byeadmin
-rw-r--r--fml/lib/FML/Command/Admin/MANIFEST.euc-jp6
-rw-r--r--fml/lib/FML/Command/Admin/addadmin.pm128
-rw-r--r--fml/lib/FML/Command/Admin/byeadmin.pm128
3 files changed, 261 insertions, 1 deletions
diff --git a/fml/lib/FML/Command/Admin/MANIFEST.euc-jp b/fml/lib/FML/Command/Admin/MANIFEST.euc-jp
index f51bf6d8..8bee4ada 100644
--- a/fml/lib/FML/Command/Admin/MANIFEST.euc-jp
+++ b/fml/lib/FML/Command/Admin/MANIFEST.euc-jp
@@ -27,6 +27,10 @@ get 任意のファイルを取り寄せる ( MIME/multipart only )
(send)
+addadmin add a new administrator
+byeadmin remove the specified administrator
+
+
○ 未実装
edit config.cf を編集する
@@ -36,4 +40,4 @@ help admin のヘルプファイルを取り寄せる
off メンバーの誰かを off にする
on メンバーの誰かを on にする
-$FML: MANIFEST.euc-jp,v 1.2 2001/10/22 12:41:59 fukachan Exp $
+$FML: MANIFEST.euc-jp,v 1.3 2002/02/20 14:10:37 fukachan Exp $
diff --git a/fml/lib/FML/Command/Admin/addadmin.pm b/fml/lib/FML/Command/Admin/addadmin.pm
new file mode 100644
index 00000000..572bdf82
--- /dev/null
+++ b/fml/lib/FML/Command/Admin/addadmin.pm
@@ -0,0 +1,128 @@
+#-*- perl -*-
+#
+# Copyright (C) 2001,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: addadmin.pm,v 1.14 2002/03/19 10:12:45 fukachan Exp $
+#
+
+package FML::Command::Admin::addadmin;
+use strict;
+use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
+use Carp;
+
+
+=head1 NAME
+
+FML::Command::Admin::addadmin - addadmin a new administrator
+
+=head1 SYNOPSIS
+
+See C<FML::Command> for more details.
+
+=head1 DESCRIPTION
+
+addadmin a new address.
+
+=head1 METHODS
+
+=head2 C<process($curproc, $command_args)>
+
+=cut
+
+
+# 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 { 1;}
+
+
+# Descriptions: addadmin a new user
+# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args)
+# Side Effects: update $member_map $recipient_map
+# Return Value: none
+sub process
+{
+ my ($self, $curproc, $command_args) = @_;
+ my $config = $curproc->{ config };
+ my $member_map = $config->{ primary_admin_member_map };
+ my $options = $command_args->{ options };
+ my $address = $command_args->{ command_data } || $options->[ 0 ];
+
+ # fundamental check
+ croak("address is not specified") unless defined $address;
+ croak("\$member_map is not specified") unless $member_map;
+
+ # FML::Command::UserControl specific parameters
+ my $uc_args = {
+ address => $address,
+ maplist => [ $member_map ],
+ };
+ my $r = '';
+
+ eval q{
+ use FML::Command::UserControl;
+ my $obj = new FML::Command::UserControl;
+ $obj->useradd($curproc, $command_args, $uc_args);
+ };
+ if ($r = $@) {
+ croak($r);
+ }
+}
+
+
+# Descriptions: addadmin a new user
+# 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 $r = '';
+
+ eval q{
+ use FML::CGI::Admin::User;
+ my $obj = new FML::CGI::Admin::User;
+ $obj->cgi_menu($curproc, $args, $command_args);
+ };
+ if ($r = $@) {
+ croak($r);
+ }
+}
+
+
+=head1 AUTHOR
+
+Ken'ichi Fukamachi
+
+=head1 COPYRIGHT
+
+Copyright (C) 2001,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::addadmin appeared in fml5 mailing list driver package.
+See C<http://www.fml.org/> for more details.
+
+=cut
+
+
+1;
diff --git a/fml/lib/FML/Command/Admin/byeadmin.pm b/fml/lib/FML/Command/Admin/byeadmin.pm
new file mode 100644
index 00000000..689d2119
--- /dev/null
+++ b/fml/lib/FML/Command/Admin/byeadmin.pm
@@ -0,0 +1,128 @@
+#-*- perl -*-
+#
+# Copyright (C) 2001,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: byeadmin.pm,v 1.11 2002/03/19 10:12:45 fukachan Exp $
+#
+
+package FML::Command::Admin::byeadmin;
+use strict;
+use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
+use Carp;
+
+
+=head1 NAME
+
+FML::Command::Admin::byeadmin - remove the specified member
+
+=head1 SYNOPSIS
+
+See C<FML::Command> for more details.
+
+=head1 DESCRIPTION
+
+byeadmin a new user.
+
+=head1 METHODS
+
+=head2 C<process($curproc, $command_args)>
+
+=cut
+
+
+# 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 { 1;}
+
+
+# Descriptions: byeadmin a new user
+# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args)
+# Side Effects: update $member_map $recipient_map
+# Return Value: none
+sub process
+{
+ my ($self, $curproc, $command_args) = @_;
+ my $config = $curproc->{ config };
+ my $member_map = $config->{ primary_admin_member_map };
+ my $options = $command_args->{ options };
+ my $address = $command_args->{ command_data } || $options->[ 0 ];
+
+ # fundamental check
+ croak("address is not specified") unless defined $address;
+ croak("\$member_map is not specified") unless $member_map;
+
+ # FML::Command::UserControl specific parameters
+ my $uc_args = {
+ address => $address,
+ maplist => [ $member_map ],
+ };
+ my $r = '';
+
+ eval q{
+ use FML::Command::UserControl;
+ my $obj = new FML::Command::UserControl;
+ $obj->userdel($curproc, $command_args, $uc_args);
+ };
+ if ($r = $@) {
+ croak($r);
+ }
+}
+
+
+# Descriptions: subscribe a new user
+# 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 $r = '';
+
+ eval q{
+ use FML::CGI::Admin::User;
+ my $obj = new FML::CGI::Admin::User;
+ $obj->cgi_menu($curproc, $args, $command_args);
+ };
+ if ($r = $@) {
+ croak($r);
+ }
+}
+
+
+=head1 AUTHOR
+
+Ken'ichi Fukamachi
+
+=head1 COPYRIGHT
+
+Copyright (C) 2001,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::byeadmin appeared in fml5 mailing list driver package.
+See C<http://www.fml.org/> for more details.
+
+=cut
+
+
+1;