Lines 330-336
sub CheckForInvalidFields {
Link Here
|
330 |
my $borrower = shift; |
330 |
my $borrower = shift; |
331 |
my @invalidFields; |
331 |
my @invalidFields; |
332 |
if ($borrower->{'email'}) { |
332 |
if ($borrower->{'email'}) { |
333 |
push(@invalidFields, "email") if (!Email::Valid->address($borrower->{'email'})); |
333 |
unless ( Email::Valid->address($borrower->{'email'}) ) { |
|
|
334 |
push(@invalidFields, "email"); |
335 |
} elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) { |
336 |
my $patrons_with_same_email = Koha::Patrons->search( { email => $borrower->{email} })->count; |
337 |
if ( $patrons_with_same_email ) { |
338 |
push @invalidFields, "duplicate_email"; |
339 |
} |
340 |
} |
334 |
} |
341 |
} |
335 |
if ($borrower->{'emailpro'}) { |
342 |
if ($borrower->{'emailpro'}) { |
336 |
push(@invalidFields, "emailpro") if (!Email::Valid->address($borrower->{'emailpro'})); |
343 |
push(@invalidFields, "emailpro") if (!Email::Valid->address($borrower->{'emailpro'})); |
337 |
- |
|
|