|
Lines 323-329
sub CheckForInvalidFields {
Link Here
|
| 323 |
my $borrower = shift; |
323 |
my $borrower = shift; |
| 324 |
my @invalidFields; |
324 |
my @invalidFields; |
| 325 |
if ($borrower->{'email'}) { |
325 |
if ($borrower->{'email'}) { |
| 326 |
push(@invalidFields, "email") if (!Email::Valid->address($borrower->{'email'})); |
326 |
unless ( Email::Valid->address($borrower->{'email'}) ) { |
|
|
327 |
push(@invalidFields, "email"); |
| 328 |
} elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) { |
| 329 |
my $patrons_with_same_email = Koha::Patrons->search( { email => $borrower->{email} })->count; |
| 330 |
if ( $patrons_with_same_email ) { |
| 331 |
push @invalidFields, "duplicate_email"; |
| 332 |
} |
| 333 |
} |
| 327 |
} |
334 |
} |
| 328 |
if ($borrower->{'emailpro'}) { |
335 |
if ($borrower->{'emailpro'}) { |
| 329 |
push(@invalidFields, "emailpro") if (!Email::Valid->address($borrower->{'emailpro'})); |
336 |
push(@invalidFields, "emailpro") if (!Email::Valid->address($borrower->{'emailpro'})); |
| 330 |
- |
|
|