Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
use CGI qw ( -utf8 );
use DateTime::TimeZone;
use CGI qw ( -utf8 );
use DateTime::TimeZone;
use File::Slurp qw( read_file );
use List::MoreUtils qw( any );
use Module::Load::Conditional qw( can_load );
use File::Slurp qw( read_file );
use List::MoreUtils qw( any );
use Module::Load::Conditional qw( can_load );
my $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist = ( not $anonymous_patron and Koha::Patrons->search({ privacy => 2 })->count );
my $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist = ( not $anonymous_patron and Koha::Patrons->search({ privacy => 2 })->count );
-my $warnPrefKohaAdminEmailAddress = not Email::Valid->address(C4::Context->preference('KohaAdminEmailAddress'));
+my $warnPrefKohaAdminEmailAddress = C4::Context->preference('KohaAdminEmailAddress') !~ m/$Email::Address::mailbox/;
my $c = Koha::Items->filter_by_visible_in_opac->count;
my @warnings = C4::Context->dbh->selectrow_array('SHOW WARNINGS');
my $c = Koha::Items->filter_by_visible_in_opac->count;
my @warnings = C4::Context->dbh->selectrow_array('SHOW WARNINGS');
requires 'Email::MessageID', '1.406';
requires 'Email::Sender', '1.300030';
requires 'Email::Stuffer', '0.014';
requires 'Email::MessageID', '1.406';
requires 'Email::Sender', '1.300030';
requires 'Email::Stuffer', '0.014';
-requires 'Email::Valid', '0.190';
requires 'Exception::Class', '1.38';
requires 'File::Slurp', '9999.13';
requires 'Font::TTF', '0.45';
requires 'Exception::Class', '1.38';
requires 'File::Slurp', '9999.13';
requires 'Font::TTF', '0.45';
use Koha::Patron::HouseboundRole;
use Koha::Patron::HouseboundRoles;
use Koha::Token;
use Koha::Patron::HouseboundRole;
use Koha::Patron::HouseboundRoles;
use Koha::Token;
use Koha::SMS::Providers;
my $input = CGI->new;
use Koha::SMS::Providers;
my $input = CGI->new;
my $emailalt = $input->param('B_email');
if ($emailprimary) {
my $emailalt = $input->param('B_email');
if ($emailprimary) {
- push (@errors, "ERROR_bad_email") if (!Email::Valid->address($emailprimary));
+ push (@errors, "ERROR_bad_email") if ($emailprimary !~ m/$Email::Address::mailbox/);
- push (@errors, "ERROR_bad_email_secondary") if (!Email::Valid->address($emailsecondary));
+ push (@errors, "ERROR_bad_email_secondary") if ($emailsecondary !~ m/$Email::Address::mailbox/);
- push (@errors, "ERROR_bad_email_alternative") if (!Email::Valid->address($emailalt));
+ push (@errors, "ERROR_bad_email_alternative") if ($emailalt !~ m/$Email::Address::mailbox/);
}
if (C4::Context->preference('ExtendedPatronAttributes') and $input->param('setting_extended_patron_attributes')) {
}
if (C4::Context->preference('ExtendedPatronAttributes') and $input->param('setting_extended_patron_attributes')) {
use Koha::Patron::Modification;
use Koha::Patron::Modifications;
use C4::Scrubber;
use Koha::Patron::Modification;
use Koha::Patron::Modifications;
use C4::Scrubber;
use Koha::DateUtils qw( dt_from_string output_pref );
use Koha::Libraries;
use Koha::Patron::Attribute::Types;
use Koha::DateUtils qw( dt_from_string output_pref );
use Koha::Libraries;
use Koha::Patron::Attribute::Types;
my $borrower = shift;
my @invalidFields;
if ($borrower->{'email'}) {
my $borrower = shift;
my @invalidFields;
if ($borrower->{'email'}) {
- unless ( Email::Valid->address($borrower->{'email'}) ) {
+ unless ( $borrower->{'email'} =~ m/$Email::Address::mailbox/ ) {
push(@invalidFields, "email");
} elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) {
my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited?
push(@invalidFields, "email");
} elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) {
my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited?
delete $borrower->{'repeat_email'};
}
if ($borrower->{'emailpro'}) {
delete $borrower->{'repeat_email'};
}
if ($borrower->{'emailpro'}) {
- push(@invalidFields, "emailpro") if (!Email::Valid->address($borrower->{'emailpro'}));
+ push(@invalidFields, "emailpro") if ($borrower->{'emailpro'} !~ m/$Email::Address::mailbox/);
}
if ($borrower->{'B_email'}) {
}
if ($borrower->{'B_email'}) {
- push(@invalidFields, "B_email") if (!Email::Valid->address($borrower->{'B_email'}));
+ push(@invalidFields, "B_email") if ($borrower->{'B_email'} !~ m/$Email::Address::mailbox/);
}
if ( defined $borrower->{'password'}
and $borrower->{'password'} ne $borrower->{'password2'} )
}
if ( defined $borrower->{'password'}
and $borrower->{'password'} ne $borrower->{'password2'} )
'/cgi-bin/koha/opac-shelves.pl?display=privateshelves&viewshelf=';
use CGI qw ( -utf8 );
'/cgi-bin/koha/opac-shelves.pl?display=privateshelves&viewshelf=';
use CGI qw ( -utf8 );
use C4::Auth qw( get_template_and_user );
use C4::Context;
use C4::Auth qw( get_template_and_user );
use C4::Context;
foreach my $a (@temp) {
$a =~ s/^\s+//;
$a =~ s/\s+$//;
foreach my $a (@temp) {
$a =~ s/^\s+//;
$a =~ s/\s+$//;
- if ( IsEmailAddress($a) ) {
+ if ( $a =~ m/$Email::Address::mailbox/ ) {
push @appr_addr, $a;
}
else {
push @appr_addr, $a;
}
else {
-sub IsEmailAddress {
-
- #TODO candidate for a module?
- return Email::Valid->address( $_[0] ) ? 1 : 0;
-}
-
sub randomlist {
#uses rand, safe enough for this application but not for more sensitive data
sub randomlist {
#uses rand, safe enough for this application but not for more sensitive data