summaryrefslogtreecommitdiff
path: root/fml/lib
diff options
context:
space:
mode:
authorfukachan <fukachan>2006-10-22 14:18:05 +0000
committerfukachan <fukachan>2006-10-22 14:18:05 +0000
commit76dacf84693521e20d86e2ff34193ed5da561248 (patch)
tree6f992a4607a452b2d7bab6b500f402249cf3c8df /fml/lib
parent1a69d4b654bae192ec110d56d1e8b9f8c5466038 (diff)
downloadfml8-76dacf84693521e20d86e2ff34193ed5da561248.tar.gz
fml8-76dacf84693521e20d86e2ff34193ed5da561248.tar.bz2
fml8-76dacf84693521e20d86e2ff34193ed5da561248.zip
clean up. fix comments.
Diffstat (limited to 'fml/lib')
-rw-r--r--fml/lib/FML/Command/Auth.pm36
-rw-r--r--fml/lib/FML/Command/DataCheck.pm52
-rw-r--r--fml/lib/FML/Command/Filter.pm15
-rw-r--r--fml/lib/FML/Command/Syntax.pm12
4 files changed, 104 insertions, 11 deletions
diff --git a/fml/lib/FML/Command/Auth.pm b/fml/lib/FML/Command/Auth.pm
index 11d3be86..dd4fa5c9 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.42 2006/03/05 08:08:36 fukachan Exp $
+# $FML: Auth.pm,v 1.43 2006/03/05 09:50:42 fukachan Exp $
#
package FML::Command::Auth;
@@ -29,7 +29,9 @@ FML::Command::Auth - authentication functions.
=head2 new()
-=head2 reject()
+constructor.
+
+=head2 reject($curproc, $optargs)
dummy :-)
@@ -37,12 +39,12 @@ dummy :-)
# Descriptions: constructor.
-# Arguments: OBJ($self) HASH_REF($args)
+# Arguments: OBJ($self)
# Side Effects: none
# Return Value: OBJ
sub new
{
- my ($self, $args) = @_;
+ my ($self) = @_;
my ($type) = ref($self) || $self;
my $me = {};
return bless $me, $type;
@@ -61,6 +63,13 @@ sub reject
}
+=head2 permit_anyone($curproc, $optargs)
+
+permit anyone.
+
+=cut
+
+
# Descriptions: permit anyone.
# Arguments: OBJ($self) OBJ($curproc) HASH_REF($optargs)
# Side Effects: none
@@ -73,6 +82,13 @@ sub permit_anyone
}
+=head2 permit_admin_member_maps($curproc, $optargs)
+
+permit if admin_member_maps has the sender.
+
+=cut
+
+
# Descriptions: permit if admin_member_maps has the sender.
# Arguments: OBJ($self) OBJ($curproc) HASH_REF($optargs)
# Side Effects: none
@@ -93,6 +109,13 @@ sub permit_admin_member_maps
}
+=head2 reject_system_special_accounts($curproc, $optargs)
+
+reject if the mail address looks like system accounts.
+
+=cut
+
+
# Descriptions: reject if the mail address looks like system accounts.
# Arguments: OBJ($self) OBJ($curproc) HASH_REF($optargs)
# Side Effects: none
@@ -105,7 +128,8 @@ sub reject_system_special_accounts
my $match = $cred->match_system_special_accounts($sender);
if ($match) {
- $curproc->logerror("reject_system_special_accounts: matches the sender");
+ my $msg = "reject_system_special_accounts: matches the sender";
+ $curproc->logerror($msg);
return '__LAST__';
}
@@ -228,6 +252,8 @@ sub check_admin_member_password
=head2 change_password($curproc, $command_context, $up_args)
+change password.
+
$up_args = {
maplist => $maps,
address => $address,
diff --git a/fml/lib/FML/Command/DataCheck.pm b/fml/lib/FML/Command/DataCheck.pm
index 7c8bab58..79e3abd3 100644
--- a/fml/lib/FML/Command/DataCheck.pm
+++ b/fml/lib/FML/Command/DataCheck.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: DataCheck.pm,v 1.19 2006/06/25 11:05:12 fukachan Exp $
+# $FML: DataCheck.pm,v 1.20 2006/07/03 13:58:32 fukachan Exp $
#
package FML::Command::DataCheck;
@@ -24,12 +24,21 @@ FML::Command::DataCheck - parse, clean up et.al. command buffer.
=head1 SYNOPSIS
+use FML::Command::DataCheck;
+my $check = new FML::Command::DataCheck;
+my ($comname, $comsubname) = $check->parse_command_buffer($clean_command);
+my $options = $check->parse_command_arguments($clean_command, $comname);
+
=head1 DESCRIPTION
+This class provides command parsing functions.
+
=head1 METHODS
=head2 new($args)
+constructor.
+
=cut
@@ -46,6 +55,20 @@ sub new
}
+=head2 parse_command_buffer($command)
+
+return command name ( ^\S+ in $command ) and the sub name as
+ARRAY (STR, STR).
+
+The returned values are already clean.
+
+=head2 parse_command_arguments($command, $comname)
+
+return arguments after command name $comname in $command as ARRAY_REF.
+
+=cut
+
+
# Descriptions: return command name ( ^\S+ in $command ) and the sub name.
# remove the prepending strings such as \s, #, ...
# Arguments: OBJ($self) STR($command)
@@ -61,7 +84,8 @@ sub parse_command_buffer
}
-# Descriptions: return arguments after command name $comname in $command.
+# Descriptions: return arguments after command name $comname in $command
+# as ARRAY_REF.
# Arguments: OBJ($self) STR($command) STR($comname)
# Side Effects: none
# Return Value: ARRAY_REF
@@ -88,6 +112,14 @@ sub parse_command_arguments
}
+=head2 find_special_keyword($curproc, $ra_data)
+
+check the message of the current process to find whether it contains
+some special keyword e.g. "confirm".
+
+=cut
+
+
#
# XXX-TODO: find_special_keyword() NOT USED ? YES. REMOVE IT.
#
@@ -131,6 +163,14 @@ sub find_special_keyword
}
+=head2 find_anonymous_command_mail_allowed_commands($curproc)
+
+check the message of the current process to find whether it contais
+special keyword e.g. "confirm".
+
+=cut
+
+
#
# XXX-TODO: find_anonymous_command_mail_allowed_commands() NOT USED? YES. RM!
#
@@ -181,6 +221,14 @@ sub find_anonymous_command_mail_allowed_commands
}
+=head2 cleanup($string)
+
+clean up the given string and return a cleaned one.
+For example, "# ls uja " -> "ls uja"
+
+=cut
+
+
# Descriptions: clean up the given string and return a cleaned one.
# For example, "# ls uja " -> "ls uja"
# Arguments: OBJ($self) STR($s)
diff --git a/fml/lib/FML/Command/Filter.pm b/fml/lib/FML/Command/Filter.pm
index f305c7dd..1b47e250 100644
--- a/fml/lib/FML/Command/Filter.pm
+++ b/fml/lib/FML/Command/Filter.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: Filter.pm,v 1.6 2004/06/26 11:47:55 fukachan Exp $
+# $FML: Filter.pm,v 1.7 2004/12/05 16:19:06 fukachan Exp $
#
package FML::Command::Filter;
@@ -23,8 +23,21 @@ FML::Command::Filter - command mail specific filters.
=head1 SYNOPSIS
+use FML::Command::Filter;
+my $_msg = $curproc->incoming_message_body();
+my $obj = new FML::Command::Filter $curproc;
+my $reason = $obj->check_command_limit($_msg);
+
=head1 DESCRIPTION
+This class provides command mail specific filters.
+
+check_command_limit() checks the number of command requests in one
+command mail.
+
+check_line_length_limit() checks the line length of each line in a
+command mail.
+
=head1 METHODS
=head2 new()
diff --git a/fml/lib/FML/Command/Syntax.pm b/fml/lib/FML/Command/Syntax.pm
index 43b30d70..71683c97 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.3 2006/03/05 08:08:36 fukachan Exp $
+# $FML: Syntax.pm,v 1.4 2006/03/05 09:50:42 fukachan Exp $
#
package FML::Command::Syntax;
@@ -18,8 +18,14 @@ FML::Command::Syntax - common command syntax checker.
=head1 SYNOPSIS
+use FML::Command::Syntax;
+push(@ISA, qw(FML::Command::Syntax));
+$self->check_syntax_address_handler($curproc, $command_context);
+
=head1 DESCRIPTION
+This class provides the syntax command string checker.
+
=head1 METHODS
=head2 check_syntax_address_handler($curproc, $command_context)
@@ -39,7 +45,7 @@ sub check_syntax_address_handler
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 $options = $command_context->get_options() || [];
my (@test) = ($comname);
my $ok = 0;
@@ -61,7 +67,7 @@ sub check_syntax_address_handler
}
}
- # 2. check other comonents
+ # 2. validate syntax of other comonents (packed in @test array).
use FML::Command;
my $dispatch = new FML::Command;
if ($dispatch->safe_regexp_match($curproc, $command_context, \@test)) {