@@ -, +, @@ OPAC registrations --- ...fRegistrationVerifyByEmailToPatron_sysprefs.perl | 21 +++++++++++++++++++++ installer/data/mysql/sysprefs.sql | 3 ++- .../prog/en/modules/admin/preferences/opac.pref | 13 +++++++++++-- 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_25090-add_PatronSelfRegistrationVerifyByEmailToLibrary_and_PatronSelfRegistrationVerifyByEmailToPatron_sysprefs.perl --- a/installer/data/mysql/atomicupdate/bug_25090-add_PatronSelfRegistrationVerifyByEmailToLibrary_and_PatronSelfRegistrationVerifyByEmailToPatron_sysprefs.perl +++ a/installer/data/mysql/atomicupdate/bug_25090-add_PatronSelfRegistrationVerifyByEmailToLibrary_and_PatronSelfRegistrationVerifyByEmailToPatron_sysprefs.perl @@ -0,0 +1,21 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + my $sth = $dbh->prepare("SELECT value from systempreferences WHERE variable='PatronSelfRegistrationVerifyByEmail'"); + $sth->execute; + my ($value) = $sth->fetchrow; + + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('PatronSelfRegistrationVerifyByEmailToPatron', '$value', NULL, 'If enabled, any patron attempting to register themselves via the OPAC will will receieve an email requiring him or her to verify themselves via email to activate their account', 'YesNo'); + }); + + $dbh->do(q{ + DELETE FROM systempreferences WHERE variable='PatronSelfRegistrationVerifyByEmail'; + }); + + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('PatronSelfRegistrationVerifyByEmailToLibrary', '0', '0|BranchEmailAddress|KohaAdminEmailAddress', 'If enabled, when a patron attempts to register themselves via the OPAC a verification email will be sent to the library to approve the activation of the patron account.', 'Choice'); + }); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 25090 - Add two new sysprefs PatronSelfRegistrationVerifyByEmailToPatron and PatronSelfRegistrationVerifyByEmailToLibrary so libraries have option to moderate which registrations get Koha accounts)\n"; +} --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -496,7 +496,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('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'), ('PatronSelfRegistrationLibraryList','',NULL,'Only display libraries listed. If empty, all libraries are displayed.','Free'), ('PatronSelfRegistrationPrefillForm','1',NULL,'Display password and prefill login form after a patron has self registered','YesNo'), -('PatronSelfRegistrationVerifyByEmail','0',NULL,'If enabled, any patron attempting to register themselves via the OPAC will be required to verify themselves via email to activate his or her account.','YesNo'), +('PatronSelfRegistrationVerifyByEmailToLibrary', '0', '0|BranchEmailAddress|KohaAdminEmailAddress', 'If enabled, when a patron attempts to register themselves via the OPAC a verification email will be sent to the library to approve the activation of the patron account.', 'Choice'), +('PatronSelfRegistrationVerifyByEmailToPatron','0',NULL,'If enabled, any patron attempting to register themselves via the OPAC will will receieve an email requiring him or her to verify themselves via email to activate their account','YesNo'), ('PatronsPerPage','20','20','Number of Patrons Per Page displayed by default','Integer'), ('EnablePayPalOpacPayments', '0', NULL , 'Enables the ability to pay fees and fines from the OPAC via PayPal', 'YesNo' ), ('PatronQuickAddFields', '', NULL , 'A list of fields separated by "|" to be displayed along with mandatory fields in the patron quick add form if chosen at patron entry', 'Free' ), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -821,12 +821,21 @@ OPAC: - "library patrons to register or modify their account via the OPAC." - "
NOTE: This needs PatronSelfRegistrationDefaultCategory to be set to a valid patron category code." - - - pref: PatronSelfRegistrationVerifyByEmail + - pref: PatronSelfRegistrationVerifyByEmailToPatron choices: yes: Require no: "Don't require" - "that a self-registering patron verify themselves via email." - - "
NOTE: This system preference requires the misc/cronjobs/cleanup_database.pl cronjob. Ask your system administrator to schedule it." + + - "

Enable librarian verification of OPAC self registrations by sending verification email to" + - pref: PatronSelfRegistrationVerifyByEmailToLibrary + default: 0 + choices: + 0: None + BranchEmailAddress: email address of branch + KohaAdminEmailAddress: KohaAdminEmailAddress + - "for a librarian to approve activation of Koha account.

" + - "
NOTE: Both of these system preferences requires the misc/cronjobs/cleanup_database.pl cronjob. Ask your system administrator to schedule it." - - "Use the patron category code" - pref: PatronSelfRegistrationDefaultCategory --