View | Details | Raw Unified | Return to bug 26067
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_26067_PatronEmailValidationMXrecord_add__system_preference.perl (+6 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do( "INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('PatronEmailValidationMXrecord','1','NULL','Mail Exchange (MX) records are DNS records that are necessary for delivering email to Patron.','YesNo')" );
4
5
    NewVersion( $DBversion, 22660, "Adds PatronEmailValidationMXrecord system preference");
6
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 492-497 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
492
('PatronSelfRegistrationConfirmEmail', '0', NULL, 'Require users to confirm their email address by entering it twice.', 'YesNo'),
492
('PatronSelfRegistrationConfirmEmail', '0', NULL, 'Require users to confirm their email address by entering it twice.', 'YesNo'),
493
('PatronSelfRegistrationDefaultCategory','','','A patron registered via the OPAC will receive a borrower category code set in this system preference.','free'),
493
('PatronSelfRegistrationDefaultCategory','','','A patron registered via the OPAC will receive a borrower category code set in this system preference.','free'),
494
('PatronSelfRegistrationEmailMustBeUnique', '0', 'If set, the field borrowers.email will be considered as a unique field on self registering', NULL, 'YesNo'),
494
('PatronSelfRegistrationEmailMustBeUnique', '0', 'If set, the field borrowers.email will be considered as a unique field on self registering', NULL, 'YesNo'),
495
('PatronEmailValidationMXrecord','1','NULL','Mail Exchange (MX) records are DNS records that are necessary for delivering email to Patron.','YesNo'),
495
('PatronSelfRegistrationExpireTemporaryAccountsDelay','0',NULL,'If PatronSelfRegistrationDefaultCategory is enabled, this system preference controls how long a patron can have a temporary status before the account is deleted automatically. It is an integer value representing a number of days to wait before deleting a temporary patron account. Setting it to 0 disables the deleting of temporary accounts.','Integer'),
496
('PatronSelfRegistrationExpireTemporaryAccountsDelay','0',NULL,'If PatronSelfRegistrationDefaultCategory is enabled, this system preference controls how long a patron can have a temporary status before the account is deleted automatically. It is an integer value representing a number of days to wait before deleting a temporary patron account. Setting it to 0 disables the deleting of temporary accounts.','Integer'),
496
('PatronSelfRegistrationLibraryList','',NULL,'Only display libraries listed. If empty, all libraries are displayed.','Free'),
497
('PatronSelfRegistrationLibraryList','',NULL,'Only display libraries listed. If empty, all libraries are displayed.','Free'),
497
('PatronSelfRegistrationPrefillForm','1',NULL,'Display password and prefill login form after a patron has self registered','YesNo'),
498
('PatronSelfRegistrationPrefillForm','1',NULL,'Display password and prefill login form after a patron has self registered','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 829-834 OPAC: Link Here
829
              syntax: text/html
829
              syntax: text/html
830
              class: html
830
              class: html
831
        -
831
        -
832
            - pref: PatronEmailValidationMXrecord
833
              choices:
834
                  yes: Require
835
                  no: "Dont't require"
836
            - "Mail Exchange (MX) records are DNS records that are necessary for delivering email to Patron." 
837
        -
832
            - pref: PatronSelfRegistrationEmailMustBeUnique
838
            - pref: PatronSelfRegistrationEmailMustBeUnique
833
              choices:
839
              choices:
834
                  yes: "Consider"
840
                  yes: "Consider"
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (+1 lines)
Lines 78-83 Link Here
78
                        <ul>
78
                        <ul>
79
                            [% FOREACH field IN invalid_form_fields %]
79
                            [% FOREACH field IN invalid_form_fields %]
80
                                [% IF field == "email" %]<li>Contact information: <a href="#borrower_email">primary email address</a></li>[% END %]
80
                                [% IF field == "email" %]<li>Contact information: <a href="#borrower_email">primary email address</a></li>[% END %]
81
                                [% IF field == "mxrecordemail" %]<li>Contact information: <a href="#borrower_email">Invalid primary email address</a></li>[% END %]
81
                                [% IF field == "emailpro" %]<li>Contact information: <a href="#borrower_emailpro">secondary email address</a></li>[% END %]
82
                                [% IF field == "emailpro" %]<li>Contact information: <a href="#borrower_emailpro">secondary email address</a></li>[% END %]
82
                                [% IF field == "B_email" %]<li>Alternate address information: <a href="#borrower_B_email">email address</a></li>[% END %]
83
                                [% IF field == "B_email" %]<li>Alternate address information: <a href="#borrower_B_email">email address</a></li>[% END %]
83
                                [% IF field == "password_match" %]<li>Passwords do not match! <a href="#password">password</a></li>[% END %]
84
                                [% IF field == "password_match" %]<li>Passwords do not match! <a href="#password">password</a></li>[% END %]
(-)a/opac/opac-memberentry.pl (-1 / +2 lines)
Lines 432-437 sub CheckForInvalidFields { Link Here
432
    if ($borrower->{'email'}) {
432
    if ($borrower->{'email'}) {
433
        unless ( Email::Valid->address($borrower->{'email'}) ) {
433
        unless ( Email::Valid->address($borrower->{'email'}) ) {
434
            push(@invalidFields, "email");
434
            push(@invalidFields, "email");
435
        } elsif ( C4::Context->preference("PatronEmailValidationMXrecord") ) {
436
            push(@invalidFields, "mxrecordemail") if ( !Email::Valid->address( -address => $borrower->{'email'}, -mxcheck => 1));  
435
        } elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) {
437
        } elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) {
436
            my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited?
438
            my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited?
437
                {
439
                {
438
- 

Return to bug 26067