diff options
author | Guilhem Moulin <guilhem.moulin@fripost.org> | 2013-01-18 21:21:17 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem.moulin@fripost.org> | 2013-01-18 21:21:17 +0100 |
commit | c70ea95c7e2e07cccbff9b7cce26e7bb506d1db6 (patch) | |
tree | d5254e9a7d23be58d3d2a9b81f02b154160b4a28 /lib/Fripost/Schema/Local.pm | |
parent | bbf7a4b561414d43bedde682c9f7b041c6de88ad (diff) |
Factorized split_addr.
Diffstat (limited to 'lib/Fripost/Schema/Local.pm')
-rw-r--r-- | lib/Fripost/Schema/Local.pm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Fripost/Schema/Local.pm b/lib/Fripost/Schema/Local.pm index 400b4e5..e2e7a4b 100644 --- a/lib/Fripost/Schema/Local.pm +++ b/lib/Fripost/Schema/Local.pm @@ -17,8 +17,9 @@ use warnings; use utf8; use parent 'Fripost::Schema'; -use Fripost::Schema::Misc 'concat'; +use Fripost::Schema::Misc qw/concat split_addr/; use Net::IDN::Encode qw/email_to_ascii email_to_unicode/; +use Net::LDAP::Util 'escape_filter_value'; =head1 METHODS @@ -39,7 +40,7 @@ sub get { my %options = @_; my $concat = $options{'-concat'}; - my ($l,$d) = split /\@/, email_to_ascii($loc), 2; + my ($l,$d) = split_addr( $loc, -encoding => 'ascii' ); my $locals = $self->ldap->search( base => "fvd=$d,".$self->suffix, scope => 'one', @@ -147,7 +148,7 @@ sub exists { die $options{'-die'}."\n" if defined $options{'-die'}; die $mesg->error."\n"; } - + } return 0; } @@ -171,7 +172,7 @@ Guilhem Moulin C<< <guilhem at fripost.org> >> =head1 COPYRIGHT -Copyright 2012 Guilhem Moulin. +Copyright 2012,2013 Guilhem Moulin. =head1 LICENSE |