Skip to content
Snippets Groups Projects
Commit 6cd1ac44 authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

use List::MoreUtils::any

parent 7f66296c
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,8 @@ use warnings; ...@@ -5,6 +5,8 @@ use warnings;
use base 'IdPAccountManager::DB::Object'; use base 'IdPAccountManager::DB::Object';
use List::MoreUtils qw(any);
__PACKAGE__->meta->setup( __PACKAGE__->meta->setup(
table => 'serviceproviders', table => 'serviceproviders',
...@@ -33,17 +35,13 @@ sub print { ...@@ -33,17 +35,13 @@ sub print {
join(',', $self->contacts()); join(',', $self->contacts());
} }
## Check if email address is a known contact (or conf.dev_sp_contact) ## Check if email address is a known contact
sub is_contact { sub is_contact {
my ($self, $email) = @_; my ($self, $email) = @_;
$email = lc($email); $email = lc($email);
foreach my $contact ($self->contacts()) { return any { $email eq lc($_) } $self->contacts();
return 1 if $email eq lc($contact);
}
return 0;
} }
1; 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment