diff options
| author | fukachan <fukachan> | 2004-03-17 10:11:35 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2004-03-17 10:11:35 +0000 |
| commit | fd2ffdf1599fdda3d91b9532329f12b7449c53fd (patch) | |
| tree | e43a943a4ca5063033970590f7c20206bb89bd6f /fml | |
| parent | 09f74b5f49ac2d8248f798638d7ec6bf47bc0a13 (diff) | |
| download | fml8-fd2ffdf1599fdda3d91b9532329f12b7449c53fd.tar.gz fml8-fd2ffdf1599fdda3d91b9532329f12b7449c53fd.tar.bz2 fml8-fd2ffdf1599fdda3d91b9532329f12b7449c53fd.zip | |
delay $config evaluation
Diffstat (limited to 'fml')
| -rw-r--r-- | fml/lib/FML/Credential.pm | 64 |
1 files changed, 38 insertions, 26 deletions
diff --git a/fml/lib/FML/Credential.pm b/fml/lib/FML/Credential.pm index cb445f0f..342e6c3e 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.54 2004/01/18 14:04:31 fukachan Exp $ +# $FML: Credential.pm,v 1.55 2004/03/13 07:41:58 fukachan Exp $ # package FML::Credential; @@ -62,36 +62,11 @@ sub new { my ($self, $curproc) = @_; my ($type) = ref($self) || $self; - my $config = $curproc->config(); - my $actype = $config->{ address_compare_function_type }; my $me = \%Credential; # default comparison level set_compare_level( $me, 3 ); - # user address check - if ($config->yes('use_address_compare_function')) { - $me->{ _use_address_compare_function } = 1; - } - else { - $me->{ _use_address_compare_function } = 0; - } - - # case insensitive for backward compatibility. (default) - if ($actype eq 'user_part_case_insensitive' || - $actype eq 'case_insensitive') { - $me->{ _user_part_case_sensitive } = 0; - } - # case sensitive for user part comparison. - elsif ($actype eq 'user_part_case_sensitive' || - $actype eq 'case_sensitive') { - $me->{ _user_part_case_sensitive } = 1; - } - # case-insensitive by default for backward compatibility. - else { - $me->{ _user_part_case_sensitive } = 0; - } - # hold pointer to $curproc $me->{ _curproc } = $curproc if defined $curproc; @@ -99,6 +74,41 @@ sub new } +sub _reconfigure +{ + my ($self) = @_; + my $curproc = $self->{ _curproc }; + + if (defined $curproc) { + my $config = $curproc->config(); + my $actype = $config->{ address_compare_function_type }; + + # user address check + if ($config->yes('use_address_compare_function')) { + $self->{ _use_address_compare_function } = 1; + } + else { + $self->{ _use_address_compare_function } = 0; + } + + # case insensitive for backward compatibility. (default) + if ($actype eq 'user_part_case_insensitive' || + $actype eq 'case_insensitive') { + $self->{ _user_part_case_sensitive } = 0; + } + # case sensitive for user part comparison. + elsif ($actype eq 'user_part_case_sensitive' || + $actype eq 'case_sensitive') { + $self->{ _user_part_case_sensitive } = 1; + } + # case-insensitive by default for backward compatibility. + else { + $self->{ _user_part_case_sensitive } = 0; + } + } +} + + # Descriptions: dummy # Arguments: OBJ($self) HASH_REF($args) # Side Effects: none @@ -194,6 +204,8 @@ sub is_same_address { my ($self, $xaddr, $yaddr, $max_level) = @_; + $self->_reconfigure(); + # always same if address_check function disabled. unless ($self->{ _use_address_compare_function }) { return 1; } |
