summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2004-04-27 13:28:06 +0000
committerfukachan <fukachan>2004-04-27 13:28:06 +0000
commitc9782dd60a38e9eef6756c8397bc82c7ce68a84d (patch)
tree21da801cee86aed3c10aeb80efd21991deac4bd7
parent4d2bbf030b652b0e17b6eec7d717d83c7b19d38c (diff)
downloadfml8-c9782dd60a38e9eef6756c8397bc82c7ce68a84d.tar.gz
fml8-c9782dd60a38e9eef6756c8397bc82c7ce68a84d.tar.bz2
fml8-c9782dd60a38e9eef6756c8397bc82c7ce68a84d.zip
implement is_same_domain().
move quotemeta() from IO::Adapter to here.
-rw-r--r--fml/lib/FML/Credential.pm26
1 files changed, 24 insertions, 2 deletions
diff --git a/fml/lib/FML/Credential.pm b/fml/lib/FML/Credential.pm
index e6627273..9f34cb4e 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.57 2004/03/17 13:22:06 fukachan Exp $
+# $FML: Credential.pm,v 1.58 2004/03/18 13:26:47 fukachan Exp $
#
package FML::Credential;
@@ -199,6 +199,10 @@ These addresses differs. But
are same since the last 3 top level domains are same.
+=head2 is_same_domain($xdomain, $ydomain)
+
+check if $xdomain and $ydomain are same or not.
+
=cut
@@ -264,6 +268,23 @@ sub is_same_address
}
+# Descriptions: check if the specified domains are same or not.
+# Arguments: OBJ($self) STR($xdomain) STR($ydomain)
+# Side Effects: none
+# Return Value: NUM
+sub is_same_domain
+{
+ my ($self, $xdomain, $ydomain) = @_;
+
+ if ("\L$xdomain\E" eq "\L$ydomain\E") {
+ return 1;
+ }
+ else {
+ return 0;
+ }
+}
+
+
=head2 is_member($curproc, $args)
return 1 if the sender is an ML member.
@@ -392,7 +413,8 @@ sub has_address_in_map
}
# $curproc->lock($lock_channel); # READER LOCK
- my $addrs = $obj->find( $user , { want => 'key', all => 1 });
+ my $_user = quotemeta($user);
+ my $addrs = $obj->find($_user , { want => 'key', all => 1 });
# $curproc->unlock($lock_channel); # READER LOCK
if (ref($addrs) && $debug) {