diff options
| author | fukachan <fukachan> | 2002-04-03 11:32:57 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-04-03 11:32:57 +0000 |
| commit | c6078a19cf75b629679bf0e511d2804fb3e1b8d5 (patch) | |
| tree | a888f5d4bdac79dabd3563b06f05c5963ccc247b /fml/lib | |
| parent | 06df1cc364822a8176ea12b4881cd9fbb1d9a881 (diff) | |
| download | fml8-c6078a19cf75b629679bf0e511d2804fb3e1b8d5.tar.gz fml8-c6078a19cf75b629679bf0e511d2804fb3e1b8d5.tar.bz2 fml8-c6078a19cf75b629679bf0e511d2804fb3e1b8d5.zip | |
clean up doc & codes, FNF-ify
Diffstat (limited to 'fml/lib')
| -rw-r--r-- | fml/lib/FML/Article.pm | 20 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/add.pm | 4 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/addadmin.pm | 12 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/addpriv.pm | 6 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/bye.pm | 6 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/byeadmin.pm | 8 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/byepriv.pm | 8 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/dir.pm | 10 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/file.pm | 12 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/remove.pm | 4 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/resign.pm | 4 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/signoff.pm | 4 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/subscribe.pm | 4 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/unsubscribe.pm | 4 | ||||
| -rw-r--r-- | fml/lib/FML/Command/User/add.pm | 4 | ||||
| -rw-r--r-- | fml/lib/FML/Command/User/bye.pm | 4 | ||||
| -rw-r--r-- | fml/lib/FML/Command/User/remove.pm | 6 | ||||
| -rw-r--r-- | fml/lib/FML/Command/User/resign.pm | 4 | ||||
| -rw-r--r-- | fml/lib/FML/Command/User/subscribe.pm | 11 | ||||
| -rw-r--r-- | fml/lib/FML/Credential.pm | 50 | ||||
| -rw-r--r-- | fml/lib/File/Sequence.pm | 58 | ||||
| -rw-r--r-- | fml/lib/Mail/Message/Spool.pm | 20 |
22 files changed, 142 insertions, 121 deletions
diff --git a/fml/lib/FML/Article.pm b/fml/lib/FML/Article.pm index 450b2405..6c90604a 100644 --- a/fml/lib/FML/Article.pm +++ b/fml/lib/FML/Article.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: Article.pm,v 1.32 2002/03/30 15:29:42 fukachan Exp $ +# $FML: Article.pm,v 1.33 2002/03/31 02:25:42 fukachan Exp $ # package FML::Article; @@ -61,8 +61,8 @@ sub new } -# Descriptions: prepare article template to distribute -# Arguments: OBJ($self) OBJ($curproc) +# Descriptions: build an article template to distribute +# Arguments: OBJ($curproc) # Side Effects: build $curproc->{ article } # Return Value: none sub _setup_article_template @@ -104,6 +104,8 @@ sub increment_id my $pcb = $curproc->{ pcb }; my $seq_file = $config->{ sequence_file }; + # XXX we should enhance IO::Adapter module to handle + # XXX sequential number. use File::Sequence; my $sfh = new File::Sequence { sequence_file => $seq_file }; my $id = $sfh->increment_id; @@ -149,18 +151,20 @@ If the variable C<$use_spool> is 'yes', this routine works. sub spool_in { my ($self, $id) = @_; - - # configurations my $curproc = $self->{ curproc }; my $config = $curproc->{ config }; my $spool_dir = $config->{ spool_dir }; if ( $config->yes( 'use_spool' ) ) { unless (-d $spool_dir) { - use File::Path; - mkpath( $spool_dir, 0, 0700 ); + eval q{ + use File::Path; + mkpath( $spool_dir, 0, 0700 ); + }; + LogError($@) if $@; } + # translate the article path e.g. spool/1900, spool/2/1900 my $file = $self->filepath($id); use FileHandle; @@ -205,8 +209,6 @@ sub filepath id => $id, } ); - Log("debug: spooled path = $file"); - return $file; } diff --git a/fml/lib/FML/Command/Admin/add.pm b/fml/lib/FML/Command/Admin/add.pm index 624cdab7..66970a3a 100644 --- a/fml/lib/FML/Command/Admin/add.pm +++ b/fml/lib/FML/Command/Admin/add.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: add.pm,v 1.4 2001/12/22 09:53:08 fukachan Exp $ +# $FML: add.pm,v 1.5 2002/02/18 14:24:11 fukachan Exp $ # package FML::Command::Admin::add; @@ -37,7 +37,7 @@ See C<FML::Command> for more details. =head1 DESCRIPTION -same as C<subscribe>. +an alias of C<FML::Command::Admin::subscribe>. =head1 AUTHOR diff --git a/fml/lib/FML/Command/Admin/addadmin.pm b/fml/lib/FML/Command/Admin/addadmin.pm index 135c04e3..5bcbb604 100644 --- a/fml/lib/FML/Command/Admin/addadmin.pm +++ b/fml/lib/FML/Command/Admin/addadmin.pm @@ -1,10 +1,10 @@ #-*- perl -*- # -# Copyright (C) 2001,2002 Ken'ichi Fukamachi +# 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: addadmin.pm,v 1.1 2002/03/19 10:31:51 fukachan Exp $ +# $FML: addadmin.pm,v 1.2 2002/03/30 11:08:35 fukachan Exp $ # package FML::Command::Admin::addadmin; @@ -15,7 +15,7 @@ use Carp; =head1 NAME -FML::Command::Admin::addadmin - addadmin a new administrator +FML::Command::Admin::addadmin - add a new administrator =head1 SYNOPSIS @@ -23,7 +23,7 @@ See C<FML::Command> for more details. =head1 DESCRIPTION -addadmin a new address. +add a new administrator address. =head1 METHODS @@ -86,7 +86,7 @@ sub process } -# Descriptions: addadmin a new user +# Descriptions: cgi menu to add a new user # Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) # Side Effects: update $member_map $recipient_map # Return Value: none @@ -112,7 +112,7 @@ Ken'ichi Fukamachi =head1 COPYRIGHT -Copyright (C) 2001,2002 Ken'ichi Fukamachi +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. diff --git a/fml/lib/FML/Command/Admin/addpriv.pm b/fml/lib/FML/Command/Admin/addpriv.pm index 9a8bf1f2..233658a5 100644 --- a/fml/lib/FML/Command/Admin/addpriv.pm +++ b/fml/lib/FML/Command/Admin/addpriv.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: add.pm,v 1.5 2002/02/18 14:24:11 fukachan Exp $ +# $FML: addpriv.pm,v 1.1 2002/03/19 11:34:37 fukachan Exp $ # package FML::Command::Admin::addpriv; @@ -29,7 +29,7 @@ sub process =head1 NAME -FML::Command::Admin::add - add a new member +FML::Command::Admin::add - add a new administrator =head1 SYNOPSIS @@ -37,7 +37,7 @@ See C<FML::Command> for more details. =head1 DESCRIPTION -same as C<addadmin>. +an alias of C<FML::Command::Admin::addadmin>. =head1 AUTHOR diff --git a/fml/lib/FML/Command/Admin/bye.pm b/fml/lib/FML/Command/Admin/bye.pm index 3c9c2f67..a6946a28 100644 --- a/fml/lib/FML/Command/Admin/bye.pm +++ b/fml/lib/FML/Command/Admin/bye.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: bye.pm,v 1.5 2001/12/22 09:53:09 fukachan Exp $ +# $FML: bye.pm,v 1.6 2002/02/18 14:24:12 fukachan Exp $ # package FML::Command::Admin::bye; @@ -30,7 +30,7 @@ sub process =head1 NAME -FML::Command::Admin::bye - remove the specified member +FML::Command::Admin::bye - remove the specified user from ML members =head1 SYNOPSIS @@ -38,7 +38,7 @@ See C<FML::Command> for more details. =head1 DESCRIPTION -save as C<unsubscribe>. +alias of C<FML::Command::Admin::unsubscribe>. =head1 AUTHOR diff --git a/fml/lib/FML/Command/Admin/byeadmin.pm b/fml/lib/FML/Command/Admin/byeadmin.pm index 39f795ce..099365fa 100644 --- a/fml/lib/FML/Command/Admin/byeadmin.pm +++ b/fml/lib/FML/Command/Admin/byeadmin.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: byeadmin.pm,v 1.1 2002/03/19 10:31:52 fukachan Exp $ +# $FML: byeadmin.pm,v 1.2 2002/03/30 11:08:35 fukachan Exp $ # package FML::Command::Admin::byeadmin; @@ -15,7 +15,7 @@ use Carp; =head1 NAME -FML::Command::Admin::byeadmin - remove the specified member +FML::Command::Admin::byeadmin - remove the specified administrator =head1 SYNOPSIS @@ -52,7 +52,7 @@ sub new sub need_lock { 1;} -# Descriptions: byeadmin a new user +# Descriptions: remove the specified administrator # Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) # Side Effects: update $member_map $recipient_map # Return Value: none @@ -86,7 +86,7 @@ sub process } -# Descriptions: subscribe a new user +# Descriptions: show cgi menu to remove the administrator # Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) # Side Effects: update $member_map $recipient_map # Return Value: none diff --git a/fml/lib/FML/Command/Admin/byepriv.pm b/fml/lib/FML/Command/Admin/byepriv.pm index 3c11c3c7..a86bcde6 100644 --- a/fml/lib/FML/Command/Admin/byepriv.pm +++ b/fml/lib/FML/Command/Admin/byepriv.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: bye.pm,v 1.5 2002/02/18 14:24:11 fukachan Exp $ +# $FML: byepriv.pm,v 1.1 2002/03/19 11:34:37 fukachan Exp $ # package FML::Command::Admin::byepriv; @@ -17,7 +17,7 @@ use FML::Command::Admin::byeadmin; @ISA = qw(FML::Command::Admin::byeadmin); -# Descriptions: bye a new admin user +# Descriptions: remove the specified administrator # Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) # Side Effects: forward request to byeadmin module # Return Value: none @@ -29,7 +29,7 @@ sub process =head1 NAME -FML::Command::Admin::bye - bye a new member +FML::Command::Admin::bye - remove the specified administrator =head1 SYNOPSIS @@ -37,7 +37,7 @@ See C<FML::Command> for more details. =head1 DESCRIPTION -same as C<byeadmin>. +an alias of C<FML::Command::Admin::byeadmin>. =head1 AUTHOR diff --git a/fml/lib/FML/Command/Admin/dir.pm b/fml/lib/FML/Command/Admin/dir.pm index 6ee36ff7..0a6d5a81 100644 --- a/fml/lib/FML/Command/Admin/dir.pm +++ b/fml/lib/FML/Command/Admin/dir.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: dir.pm,v 1.1 2002/03/19 11:13:45 fukachan Exp $ +# $FML: dir.pm,v 1.1 2002/03/24 11:26:46 fukachan Exp $ # package FML::Command::Admin::dir; @@ -15,7 +15,7 @@ use Carp; =head1 NAME -FML::Command::Admin::dir - dir file operations +FML::Command::Admin::dir - show "ls" results =head1 SYNOPSIS @@ -23,7 +23,7 @@ See C<FML::Command> for more details. =head1 DESCRIPTION -dir a new address. +show "ls" results =head1 METHODS @@ -52,7 +52,7 @@ sub new sub need_lock { 0;} -# Descriptions: dir a new user +# Descriptions: show result by "ls -l" # Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) # Side Effects: update $member_map $recipient_map # Return Value: none @@ -82,7 +82,7 @@ sub process } -# Descriptions: log a new user +# Descriptions: cgi menu (dummy) # Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) # Side Effects: update $member_map $recipient_map # Return Value: none diff --git a/fml/lib/FML/Command/Admin/file.pm b/fml/lib/FML/Command/Admin/file.pm index f4841d7b..2850dad1 100644 --- a/fml/lib/FML/Command/Admin/file.pm +++ b/fml/lib/FML/Command/Admin/file.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: file.pm,v 1.1 2002/03/26 04:01:36 fukachan Exp $ +# $FML: file.pm,v 1.1 2002/03/30 10:18:34 fukachan Exp $ # package FML::Command::Admin::file; @@ -15,7 +15,7 @@ use Carp; =head1 NAME -FML::Command::Admin::file - file file operations +FML::Command::Admin::file - functions for file operations =head1 SYNOPSIS @@ -52,16 +52,16 @@ sub new sub need_lock { 1;} -# Descriptions: this command needs "command subcommand parameters" style or not +# Descriptions: needs "command subcommand parameters" style or not # Arguments: none # Side Effects: none # Return Value: NUM( 1 or 0) sub is_subcommand_style { 1;} -# Descriptions: file a new user +# Descriptions: wrapper for file operations # Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) -# Side Effects: update $member_map $recipient_map +# Side Effects: file is created, renamed and removed # Return Value: none sub process { @@ -95,7 +95,7 @@ sub process } -# Descriptions: log a new user +# Descriptions: show cgi menu (dummy) # Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) # Side Effects: update $member_map $recipient_map # Return Value: none diff --git a/fml/lib/FML/Command/Admin/remove.pm b/fml/lib/FML/Command/Admin/remove.pm index 640771b6..8d670312 100644 --- a/fml/lib/FML/Command/Admin/remove.pm +++ b/fml/lib/FML/Command/Admin/remove.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: remove.pm,v 1.5 2002/02/18 14:24:12 fukachan Exp $ +# $FML: remove.pm,v 1.6 2002/02/20 14:10:37 fukachan Exp $ # package FML::Command::Admin::remove; @@ -38,7 +38,7 @@ See C<FML::Command> for more details. =head1 DESCRIPTION -same as C<unsubscribe>. +an alias of C<FML::Command::Admin::unsubscribe>. =head1 AUTHOR diff --git a/fml/lib/FML/Command/Admin/resign.pm b/fml/lib/FML/Command/Admin/resign.pm index 4b2096a8..22dd0a2f 100644 --- a/fml/lib/FML/Command/Admin/resign.pm +++ b/fml/lib/FML/Command/Admin/resign.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: resign.pm,v 1.5 2001/12/22 09:53:09 fukachan Exp $ +# $FML: resign.pm,v 1.6 2002/02/18 14:24:12 fukachan Exp $ # package FML::Command::Admin::resign; @@ -29,7 +29,7 @@ sub process =head1 NAME -FML::Command::Admin::resign - alias of "unsubscribe" command +FML::Command::Admin::resign - remove the specified user =head1 SYNOPSIS diff --git a/fml/lib/FML/Command/Admin/signoff.pm b/fml/lib/FML/Command/Admin/signoff.pm index 9751c436..663fb35e 100644 --- a/fml/lib/FML/Command/Admin/signoff.pm +++ b/fml/lib/FML/Command/Admin/signoff.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: signoff.pm,v 1.5 2002/02/18 14:24:12 fukachan Exp $ +# $FML: signoff.pm,v 1.6 2002/02/20 14:10:37 fukachan Exp $ # package FML::Command::Admin::signoff; @@ -30,7 +30,7 @@ sub process =head1 NAME -FML::Command::Admin::signoff - signoff the specified member +FML::Command::Admin::signoff - remove the specified member =head1 SYNOPSIS diff --git a/fml/lib/FML/Command/Admin/subscribe.pm b/fml/lib/FML/Command/Admin/subscribe.pm index fc65cff9..25da9fa6 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.14 2002/03/19 10:12:45 fukachan Exp $ +# $FML: subscribe.pm,v 1.15 2002/03/30 11:08:35 fukachan Exp $ # package FML::Command::Admin::subscribe; @@ -88,7 +88,7 @@ sub process } -# Descriptions: subscribe a new user +# 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 diff --git a/fml/lib/FML/Command/Admin/unsubscribe.pm b/fml/lib/FML/Command/Admin/unsubscribe.pm index bf2e1c28..c5f9708e 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.11 2002/03/19 10:12:45 fukachan Exp $ +# $FML: unsubscribe.pm,v 1.12 2002/03/30 11:08:35 fukachan Exp $ # package FML::Command::Admin::unsubscribe; @@ -88,7 +88,7 @@ sub process } -# Descriptions: subscribe a new user +# Descriptions: show cgi menu for unsubscribe # Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) # Side Effects: update $member_map $recipient_map # Return Value: none diff --git a/fml/lib/FML/Command/User/add.pm b/fml/lib/FML/Command/User/add.pm index 45e818d6..c676b8c7 100644 --- a/fml/lib/FML/Command/User/add.pm +++ b/fml/lib/FML/Command/User/add.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: add.pm,v 1.5 2001/12/22 16:10:51 fukachan Exp $ +# $FML: add.pm,v 1.6 2002/02/18 14:14:52 fukachan Exp $ # package FML::Command::User::add; @@ -38,7 +38,7 @@ See C<FML::Command> for more details. =head1 DESCRIPTION -forward request to C<subscribe> module. +forward request to C<FML::Command::User::subscribe> module. =head1 AUTHOR diff --git a/fml/lib/FML/Command/User/bye.pm b/fml/lib/FML/Command/User/bye.pm index 4a7b3f50..1ecebb66 100644 --- a/fml/lib/FML/Command/User/bye.pm +++ b/fml/lib/FML/Command/User/bye.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: bye.pm,v 1.6 2001/12/22 09:53:09 fukachan Exp $ +# $FML: bye.pm,v 1.7 2002/02/18 14:14:52 fukachan Exp $ # package FML::Command::User::bye; @@ -38,7 +38,7 @@ See C<FML::Command> for more details. =head1 DESCRIPTION -same as C<unsubscribe>. +alias of C<FML::Command::User::unsubscribe>. =head1 AUTHOR diff --git a/fml/lib/FML/Command/User/remove.pm b/fml/lib/FML/Command/User/remove.pm index 5af07598..88e76921 100644 --- a/fml/lib/FML/Command/User/remove.pm +++ b/fml/lib/FML/Command/User/remove.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: remove.pm,v 1.6 2002/02/18 14:14:53 fukachan Exp $ +# $FML: remove.pm,v 1.7 2002/02/20 14:10:38 fukachan Exp $ # package FML::Command::User::remove; @@ -30,7 +30,7 @@ sub process =head1 NAME -FML::Command::User::remove - remove the specified member +FML::Command::User::remove - unsubscribe =head1 SYNOPSIS @@ -38,7 +38,7 @@ See C<FML::Command> for more details. =head1 DESCRIPTION -same as C<unsubscribe>. +alias of C<FML::Command::User::unsubscribe>. =head1 AUTHOR diff --git a/fml/lib/FML/Command/User/resign.pm b/fml/lib/FML/Command/User/resign.pm index 850bef8b..d8c08761 100644 --- a/fml/lib/FML/Command/User/resign.pm +++ b/fml/lib/FML/Command/User/resign.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: resign.pm,v 1.6 2002/02/18 14:14:53 fukachan Exp $ +# $FML: resign.pm,v 1.7 2002/02/20 14:10:38 fukachan Exp $ # package FML::Command::User::resign; @@ -29,7 +29,7 @@ sub process =head1 NAME -FML::Command::User::resign - alias of "unsubscribe" command +FML::Command::User::resign - unsubscribe =head1 SYNOPSIS diff --git a/fml/lib/FML/Command/User/subscribe.pm b/fml/lib/FML/Command/User/subscribe.pm index f5a3e5b8..ac423f6b 100644 --- a/fml/lib/FML/Command/User/subscribe.pm +++ b/fml/lib/FML/Command/User/subscribe.pm @@ -4,23 +4,19 @@ # 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.10 2002/02/17 08:13:25 fukachan Exp $ +# $FML: subscribe.pm,v 1.11 2002/02/18 14:14:53 fukachan Exp $ # package FML::Command::User::subscribe; use strict; use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; - - - use FML::Log qw(Log LogWarn LogError); - =head1 NAME -FML::Command::User::subscribe - subscribe a new member +FML::Command::User::subscribe - subscribe =head1 SYNOPSIS @@ -58,7 +54,8 @@ sub new sub need_lock { 1;} -# Descriptions: subscribe adapter: confirm before subscribe +# Descriptions: subscribe adapter. +# we confirm it before real subscribe process. # Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) # Side Effects: update database for confirmation. # prepare reply message. diff --git a/fml/lib/FML/Credential.pm b/fml/lib/FML/Credential.pm index c2b156a3..05528d2d 100644 --- a/fml/lib/FML/Credential.pm +++ b/fml/lib/FML/Credential.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: Credential.pm,v 1.21 2002/01/27 09:25:22 fukachan Exp $ +# $FML: Credential.pm,v 1.22 2002/03/22 11:36:05 fukachan Exp $ # package FML::Credential; @@ -16,7 +16,7 @@ use ErrorStatus qw(errstr error error_set error_clear); =head1 NAME -FML::Credential - authenticate the mail sender +FML::Credential - functions to authenticate the mail sender =head1 SYNOPSIS @@ -30,11 +30,17 @@ FML::Credential - authenticate the mail sender a collection of utilitity functions to authenticate the sender who kicks off this mail. +=head2 User credential information + +C<%Credential> information is unique in one fml process. +So this hash is accessible in public. + =head1 METHODS =head2 C<new()> -bind \%Credential to $self and return it as an object. +bind $self to the module internal C<\%Credential> hash and return the +has reference as an object. =cut @@ -44,7 +50,7 @@ bind \%Credential to $self and return it as an object. # you can access the same \%Credential through this object. # Arguments: OBJ($self) # Side Effects: bind $self ($me) to \%Credential -# Return Value: object +# Return Value: OBJ sub new { my ($self) = @_; @@ -95,10 +101,10 @@ are same since the last 3 top level domains are same. =cut -# Descriptions: compare addresses are same. +# Descriptions: compare whether the given addresses are same or not. # Arguments: OBJ($self) STR($xaddr) STR($xaddr) NUM($max_level) # Side Effects: none -# Return Value: 1 or 0 +# Return Value: NUM(1 or 0) sub is_same_address { my ($self, $xaddr, $yaddr, $max_level) = @_; @@ -140,13 +146,13 @@ return 0 if not. # Descriptions: sender of the current process is an ML member or not. # Arguments: OBJ($self) OBJ($curproc) HASH_REF($args) # Side Effects: none -# Return Value: 1 or 0 +# Return Value: NUM(1 or 0) sub is_member { my ($self, $curproc, $args) = @_; - my $status = 0; my $member_maps = $curproc->{ config }->{ member_maps }; my $address = $args->{ address } || $curproc->{'credential'}->{'sender'}; + my $status = 0; $self->_is_member($curproc, $args, { address => $address, @@ -158,7 +164,7 @@ sub is_member # Descriptions: sender of the current process is an ML administrator ? # Arguments: OBJ($self) OBJ($curproc) HASH_REF($args) # Side Effects: none -# Return Value: 1 or 0 +# Return Value: NUM(1 or 0) sub is_privileged_member { my ($self, $curproc, $args) = @_; @@ -175,14 +181,15 @@ sub is_privileged_member # Descriptions: sender of the current process is an ML member or not. # Arguments: OBJ($self) OBJ($curproc) HASH_REF($args) HASH_REF($optargs) # Side Effects: none -# Return Value: 1 or 0 +# Return Value: NUM(1 or 0) sub _is_member { my ($self, $curproc, $args, $optargs) = @_; - my $address = $optargs->{ address }; my $member_maps = $optargs->{ member_maps }; - my ($user, $domain) = (); - my $status = 0; + my $address = $optargs->{ address }; + my $status = 0; + my $user = ''; + my $domain = ''; if (defined $address) { ($user, $domain) = split(/\@/, $address); @@ -209,13 +216,12 @@ sub _is_member # by is_same_address(). # Arguments: OBJ($self) STR($map) STR($address) # Side Effects: none -# Return Value: 1 or 0 +# Return Value: NUM(1 or 0) sub has_address_in_map { my ($self, $map, $address) = @_; - my $status = 0; - my ($user, $domain) = split(/\@/, $address); + my $status = 0; use IO::Adapter; my $obj = new IO::Adapter $map; @@ -282,10 +288,10 @@ process. =cut -# Descriptions: returh the mail sender +# Descriptions: return the mail sender # Arguments: OBJ($self) # Side Effects: none -# Return Value: mail address +# Return Value: STR(mail address) sub sender { my ($self) = @_; @@ -347,7 +353,13 @@ sub get_compare_level sub get { my ($self, $key) = @_; - $self->{ $key }; + + if (defined $self->{ $key }) { + return $self->{ $key }; + } + else { + return ''; + } } diff --git a/fml/lib/File/Sequence.pm b/fml/lib/File/Sequence.pm index 2ee89b1a..901ae9a2 100644 --- a/fml/lib/File/Sequence.pm +++ b/fml/lib/File/Sequence.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: Sequence.pm,v 1.20 2002/02/20 11:53:22 tmu Exp $ +# $FML: Sequence.pm,v 1.21 2002/02/27 09:20:34 tmu Exp $ # package File::Sequence; @@ -240,7 +240,7 @@ sub search_max_id } -# Descriptions: search max id number from bottom +# Descriptions: search max id number from the bottom # Arguments: OBJ($self) HASH_REF($args) # Side Effects: none # Return Value: NUM @@ -276,46 +276,44 @@ sub _search_max_id_from_bottom } } -# Descriptions: search max id number from top +# Descriptions: search max id number from the top # Arguments: OBJ($self) HASH_REF($args) # Side Effects: none # Return Value: NUM sub _search_max_id_from_top { - my ($self, $args) = @_; - my ($pebot, $k, $v); - my $unit = 50; - my $debug = 1; + my ($self, $args) = @_; + my ($pebot, $k, $v); + my $unit = 50; + my $debug = 1; - $pebot = $self->get_id(); - print STDERR "get_id ", $pebot, "\n" if $debug; + $pebot = $self->get_id(); + print STDERR "get_id ", $pebot, "\n" if $debug; - if (defined $args->{ hash }) { - my $hash = $args->{ hash }; + if (defined $args->{ hash }) { + my $hash = $args->{ hash }; - print STDERR "0. ", $pebot, "\n" if $debug; + print STDERR "0. ", $pebot, "\n" if $debug; - PEBOT_SEARCH: - while ($pebot > 0) { - last PEBOT_SEARCH if defined $hash->{ $pebot - $unit }; - last PEBOT_SEARCH if(($pebot - $unit) <= 0); - $pebot -= $unit; - print STDERR "1. ", $pebot, "\n" if defined $ENV{'debug'}; - } + PEBOT_SEARCH: + while ($pebot > 0) { + last PEBOT_SEARCH if defined $hash->{ $pebot - $unit }; + last PEBOT_SEARCH if(($pebot - $unit) <= 0); + $pebot -= $unit; + } -# decrement by 1. - while(! defined $hash->{ $pebot - 1 }) { - $pebot--; - return 0 if($pebot <= 0); - print STDERR "2. ", $pebot, "\n" if defined $ENV{'debug'}; - } + # decrement by 1. + while(! defined $hash->{ $pebot - 1 }) { + $pebot--; + return 0 if($pebot <= 0); + } - return $pebot; + return $pebot; - } - else { - warn("no argument"); - } + } + else { + warn("no argument"); + } } diff --git a/fml/lib/Mail/Message/Spool.pm b/fml/lib/Mail/Message/Spool.pm index 3a870203..43ad7f17 100644 --- a/fml/lib/Mail/Message/Spool.pm +++ b/fml/lib/Mail/Message/Spool.pm @@ -2,7 +2,7 @@ # # Copyright (C) 2002 Ken'ichi Fukamachi # -# $FML: Spool.pm,v 1.2 2002/03/31 02:25:44 fukachan Exp $ +# $FML: Spool.pm,v 1.3 2002/03/31 09:42:36 fukachan Exp $ # package Mail::Message::Spool; @@ -12,19 +12,25 @@ use Carp; =head1 NAME -Mail::Message::Spool - utilities for Spool style format +Mail::Message::Spool - utilities to handle directory such as article spool =head1 SYNOPSIS use Mail::Message::Spool; - my $Spool = new Mail::Message::Spool; + my $spool = new Mail::Message::Spool; + my $file = $spool->filepath($args); =head1 DESCRIPTION +C<Mail::Message::Spool> class provides utility functions to handle a +directory such as article spool. + =head1 METHODS =head2 new() +standard constructor. + =cut @@ -43,7 +49,8 @@ sub new =head2 filepath($args) -return article file path. +return article file path. If you use hierarchical subdirectories, +this filepath() conversion is useful. $args = { base_dir => $base_dir, @@ -51,6 +58,8 @@ return article file path. use_subdir => 0, # 1 or 0 }; +where C<base_dir> and C<id> are mandatory. + =cut @@ -88,6 +97,9 @@ sub filepath } +# +# test +# if ($0 eq __FILE__) { my $obj = new Mail::Message::Spool; |
