https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25090
--- Comment #4 from Alex Buckley <alexbuck...@catalyst.net.nz> --- Created attachment 103536 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=103536&action=edit Bug 25090: Add sysprefs to define destination of OPAC self reg verification emails Online resources such as Ancestry, EBSCO etc. often charge on a usage basis and for library users to access them they need a Koha OPAC login. Enabling PatronSelfRegistration syspref allows patrons to immediately create a Koha patron and have the ability to login to the OPAC. Enabling PatronSelfRegistrationVerifyByEmail delays when the patron can login to the OPAC until after they have clicked on the verification email sent to their entered email address. Currently there is no way for libraries to moderate self registrations and prevent certain users (e.g. registrations from outside an organisation) from having OPAC logins and therefore access to paid online resources. This enhancement adds two new system preferences PatronSelfRegistrationVerificationRecipient and PatronSelfRegistrationVerificationRecipientAddress. These new system preferences work in the same way as existing sysprefs EmailPurchaseSuggestions, EmailAddressForSuggestions, and they keep the current Koha behaviour as their default. The former new syspref allows librarians to control where the verification email (generated after OPAC self registration form is submitted) goes to. The choices are: A. Self registering patrons selected home library email B. KohaAdminEmailAddress - Although ReplyToDefault syspref is defaulted to be used first C. Email address entered into PatronSelfRegistrationVerificationRecipientAddress D. Self registering patron email address - This is the default set for PatronSelfRegistrationVerificationRecipient. If A,B,C is selected then a new STAFF_OPAC_REG_VERIFY notice is sent to the library staff after the OPAC self registration form is submitted. The library staff can then review the submitted patron information and if they are happy for that user to have a OPAC login they click the verification link. Whereupon a patron account is added to the Koha borrowers table and the 'SELF_REG_APPROVED' notice containing a password reset link is sent to the patron. If D is selected then after submitting the OPAC self registration form is submitted then the patron is emailed the OPAC_REG_VERIFY notice directly and they can click the verification link whereupon they have a OPAC login. Test plan: 1. Enable PatronSelfRegistration, PatronSelfRegistrationVerifyByEmail, and OpacResetPassword sysprefs. Also ensure there are different values in KohaAdminEmailAddress, ReplyToAddress sysprefs and branch email address (Administration > Libraries) 2. Visit OPAC click registration link 3. Submit form and query the database: select to_address from message_queue where letter_code='OPAC_REG_VERIFY'; 4. Observe the verification email is sent directly to the email address entered in step #3 5. Apply patch and restart plack 6. update database: cd installer/data/mysql sudo koha-shell <instancename> ./updatedatabase.pl 7. Observe 2 new sysprefs: * PatronSelfRegistrationVerificationRecipient -> Note this has default value of 'email address of Self registering patron' * PatronSelfRegistrationVerificationRecipientAddress 8. Repeat steps 2,3,4 and observe the 'OPAC_REG_VERIFY' notices is still sent directly to the patron 9. Change PatronSelfRegistrationVerificationRecipient to 'email address of branch' 10. Revisit the OPAC, resubmit the OPAC self registration (setting the library to a library with a email set in step #1) and observe text is displayed telling you that your self registration has been sent to librarians for approval 11. Query the database: select to_address, content from message_queue where letter_code='STAFF_OPAC_REG_VERIFY'; Observe that the STAFF_OPAC_REG_VERIFY notice was sent to the individual library email address and contains: * Card number * Name: title firstname surname * Physical address: streetnumber, streettype, address, address2, city, state, zipcode, country * Email * Phone * Mobile * Fax * Secondary email * Secondary phone * Home library * Temporary patron category And a verification link 12. Query the database and observe the patron added in step 8 doesn't yet exist in the borrowers table, e.g: select * from borrowers where email=<email you entered>; 13. Copy the verification link from step #11 into your browser 14. Observe the OPAC is displaying text telling you a password reset link email was sent to patron 15. Query the database and observe the patron has been added to the borrowers table now: select * from borrowers where email=<email you entered>; 16. Query the message_queue table and observe the password reset email 'SELF_REG_APPROVED' has been sent to the patron: select to_address, content from message_queue where letter_code='SELF_REG_APPROVED'; 17. Click on the password reset link in that email and observe the password reset page in the OPAC loads with the login username and email; are prefilled. 18. Reset the password and try logging in and observe you are able to. 19. Change PatronSelfRegistrationVerificationRecipient to 'KohaAdminEmailAddress' and repeat steps 10 and 11 and observe the 'STAFF_OPAC_REG_VERIFY' notice has been sent to ReplyToDefault syspref email 20. Repeat steps 12, 13, 14, 15, 16, 17, 18 and observe they all have the same outcomes as when PatronSelfRegistrationVerificationRecipient was set to 'email address of branch' 21. Change PatronSelfRegistrationVerificationRecipient to 'PatronSelfRegistrationVerificationRecipientAddress' and then set a different email address in PatronSelfRegistrationVerificationRecipientAddress' 22. Repeat steps 10 and 11 and observe the 'STAFF_OPAC_REG_VERIFY' notice has been sent to the email you set in PatronSelfRegistrationVerificationRecipientAddress 23. Repeat steps 12, 13, 14, 15, 16, 17, 18 and observe they all have the same outcomes as when PatronSelfRegistrationVerificationRecipient was set to 'email address of branch' 24. Run tests: sudo koha-shell <instancename> prove xt prove t Sponsored-By: Mental Health Education Resource Centre, NZ -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/