|
Lines 34-40
use Koha::Patron::Consent;
Link Here
|
| 34 |
use Koha::Patron::Modification; |
34 |
use Koha::Patron::Modification; |
| 35 |
use Koha::Patron::Modifications; |
35 |
use Koha::Patron::Modifications; |
| 36 |
use C4::Scrubber; |
36 |
use C4::Scrubber; |
| 37 |
use Email::Valid; |
37 |
use Email::Address; |
| 38 |
use Koha::DateUtils; |
38 |
use Koha::DateUtils; |
| 39 |
use Koha::Libraries; |
39 |
use Koha::Libraries; |
| 40 |
use Koha::Patron::Attribute::Types; |
40 |
use Koha::Patron::Attribute::Types; |
|
Lines 445-451
sub CheckForInvalidFields {
Link Here
|
| 445 |
my $borrower = shift; |
445 |
my $borrower = shift; |
| 446 |
my @invalidFields; |
446 |
my @invalidFields; |
| 447 |
if ($borrower->{'email'}) { |
447 |
if ($borrower->{'email'}) { |
| 448 |
unless ( Email::Valid->address($borrower->{'email'}) ) { |
448 |
unless ( $borrower->{'email'} =~ m/$Email::Address::mailbox/ ) { |
| 449 |
push(@invalidFields, "email"); |
449 |
push(@invalidFields, "email"); |
| 450 |
} elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) { |
450 |
} elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) { |
| 451 |
my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited? |
451 |
my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited? |
|
Lines 471-480
sub CheckForInvalidFields {
Link Here
|
| 471 |
delete $borrower->{'repeat_email'}; |
471 |
delete $borrower->{'repeat_email'}; |
| 472 |
} |
472 |
} |
| 473 |
if ($borrower->{'emailpro'}) { |
473 |
if ($borrower->{'emailpro'}) { |
| 474 |
push(@invalidFields, "emailpro") if (!Email::Valid->address($borrower->{'emailpro'})); |
474 |
push(@invalidFields, "emailpro") if ($borrower->{'emailpro'} !~ m/$Email::Address::mailbox/); |
| 475 |
} |
475 |
} |
| 476 |
if ($borrower->{'B_email'}) { |
476 |
if ($borrower->{'B_email'}) { |
| 477 |
push(@invalidFields, "B_email") if (!Email::Valid->address($borrower->{'B_email'})); |
477 |
push(@invalidFields, "B_email") if ($borrower->{'B_email'} !~ m/$Email::Address::mailbox/); |
| 478 |
} |
478 |
} |
| 479 |
if ( defined $borrower->{'password'} |
479 |
if ( defined $borrower->{'password'} |
| 480 |
and $borrower->{'password'} ne $borrower->{'password2'} ) |
480 |
and $borrower->{'password'} ne $borrower->{'password2'} ) |