From 4beae3b11f9009a04f3469cef530a90ad7acb7df Mon Sep 17 00:00:00 2001 From: Amit Gupta Date: Sun, 9 Aug 2020 16:12:28 +0000 Subject: [PATCH] Bug 26067 Member email validation based on MX record. To Test Currently we are doing testing for Primary email address from the OPAC page. 1. Enable system preference PatronSelfRegistration. 2. Set PatronSelfRegistrationDefaultCategory for ex: ST 3. Set PatronSelfRegistrationLibraryList for ex: MPL 4. Open the page /cgi-bin/koha/opac-memberentry.pl 5. Fill the form and enter email address in Primary email for ex: amit@gmail12.com you will able to submit the page and it will not give any error message. 6. Apply the patch. 7. Enable system preference PatronEmailValidationMXrecord set as Require. 8. Open the /cgi-bin/koha/opac-memberentry.pl again. 9. Fill the form and enter email address in Primary email for ex: amit@gmail12.com and click on Submit button and it will give error message "Invalid primary email address". --- ...26067_PatronEmailValidationMXrecord_add__system_preference.perl | 7 +++++++ .../intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 6 ++++++ koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt | 1 + opac/opac-memberentry.pl | 2 ++ 4 files changed, 16 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_26067_PatronEmailValidationMXrecord_add__system_preference.perl diff --git a/installer/data/mysql/atomicupdate/bug_26067_PatronEmailValidationMXrecord_add__system_preference.perl b/installer/data/mysql/atomicupdate/bug_26067_PatronEmailValidationMXrecord_add__system_preference.perl new file mode 100644 index 0000000..3354957 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_26067_PatronEmailValidationMXrecord_add__system_preference.perl @@ -0,0 +1,7 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('PatronEmailValidationMXrecord','0','NULL','Mail Exchange (MX) records are DNS records that are necessary for delivering email to Patron.','YesNo')" ); + + NewVersion( $DBversion, 22660, "Adds PatronEmailValidationMXrecord system preference"); +} + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 6805e6f..33e69e6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -790,6 +790,12 @@ OPAC: - "library patrons to register for an account via the OPAC." - "
NOTE: This needs PatronSelfRegistrationDefaultCategory to be set to a valid patron category code." - + - pref: PatronEmailValidationMXrecord + choices: + yes: Require + no: "Dont't require" + - "Mail Exchange (MX) records are DNS records that are necessary for delivering email to Patron." + - - pref: PatronSelfRegistrationVerifyByEmail choices: yes: Require diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt index 7acd45a..066a6d8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -78,6 +78,7 @@