Lines 34-41
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::Address; |
|
|
38 |
use Koha::DateUtils; |
37 |
use Koha::DateUtils; |
|
|
38 |
use Koha::Email; |
39 |
use Koha::Libraries; |
39 |
use Koha::Libraries; |
40 |
use Koha::Patron::Attribute::Types; |
40 |
use Koha::Patron::Attribute::Types; |
41 |
use Koha::Patron::Attributes; |
41 |
use Koha::Patron::Attributes; |
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 ( $borrower->{'email'} =~ m/$Email::Address::mailbox/ ) { |
448 |
unless ( Koha::Email->is_valid($borrower->{email}) ) { |
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 ($borrower->{'emailpro'} !~ m/$Email::Address::mailbox/); |
474 |
push(@invalidFields, "emailpro") unless Koha::Email->is_valid($borrower->{'emailpro'}); |
475 |
} |
475 |
} |
476 |
if ($borrower->{'B_email'}) { |
476 |
if ($borrower->{'B_email'}) { |
477 |
push(@invalidFields, "B_email") if ($borrower->{'B_email'} !~ m/$Email::Address::mailbox/); |
477 |
push(@invalidFields, "B_email") unless Koha::Email->is_valid($borrower->{'B_email'}); |
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'} ) |