|
Lines 440-446
sub CheckForInvalidFields {
Link Here
|
| 440 |
my $borrower = shift; |
440 |
my $borrower = shift; |
| 441 |
my @invalidFields; |
441 |
my @invalidFields; |
| 442 |
if ($borrower->{'email'}) { |
442 |
if ($borrower->{'email'}) { |
| 443 |
unless ( Email::Valid->address($borrower->{'email'}) ) { |
443 |
unless ( Email::Valid->address(-address => $borrower->{'email'}, fqdn => 0) ) { |
| 444 |
push(@invalidFields, "email"); |
444 |
push(@invalidFields, "email"); |
| 445 |
} elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) { |
445 |
} elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) { |
| 446 |
my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited? |
446 |
my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited? |
|
Lines 466-475
sub CheckForInvalidFields {
Link Here
|
| 466 |
delete $borrower->{'repeat_email'}; |
466 |
delete $borrower->{'repeat_email'}; |
| 467 |
} |
467 |
} |
| 468 |
if ($borrower->{'emailpro'}) { |
468 |
if ($borrower->{'emailpro'}) { |
| 469 |
push(@invalidFields, "emailpro") if (!Email::Valid->address($borrower->{'emailpro'})); |
469 |
push(@invalidFields, "emailpro") if (!Email::Valid->address(-address => $borrower->{'emailpro'}, fqdn => 0)); |
| 470 |
} |
470 |
} |
| 471 |
if ($borrower->{'B_email'}) { |
471 |
if ($borrower->{'B_email'}) { |
| 472 |
push(@invalidFields, "B_email") if (!Email::Valid->address($borrower->{'B_email'})); |
472 |
push(@invalidFields, "B_email") if (!Email::Valid->address(-address => $borrower->{'B_email'}, fqdn => 0)); |
| 473 |
} |
473 |
} |
| 474 |
if ( defined $borrower->{'password'} |
474 |
if ( defined $borrower->{'password'} |
| 475 |
and $borrower->{'password'} ne $borrower->{'password2'} ) |
475 |
and $borrower->{'password'} ne $borrower->{'password2'} ) |