https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25090

--- Comment #12 from Alex Buckley <alexbuck...@catalyst.net.nz> ---
Created attachment 104383
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=104383&action=edit
Bug 25090: Allow libraries to verify OPAC self registrations

These patchsets add two new sysprefs (to replace
PatronSelfRegistrationVerifyByEmail), they are:

* PatronSelfRegistrationVerifyByEmailToLibrary - Library verifies OPAC
self registrations before a record is added to borrowers database table

* PatronSelfRegistrationVerifyByEmailToPatron - Patron must verify
their email before a record is added to borrowers database table

----------

4 possible email verification workflow scenarios:

1) library verification = disabled & patron verification = disabled :
   1a) Patron submits OPAC self reg form
   1b) Patron account created immediately

2) library verification = enabled & patron verification = disabled :
   2a) Patron submits OPAC self reg form
   2b) Koha sends notice to library to review registration
   2c) Library approves reg by clicking verification link in notice
   2d) Patron account is created
   2e) Password reset link emailed to patron

3) library verification = disabled & patron verification = enabled :
   3a) Patron submits OPAC self reg form
   3b) Koha sends verification email to patron
   3c) Patron clicks verification link in notice
   3d) Patron account is created

4) library verification = enabled & patron verification = enabled :
   4a) Patron submits OPAC self reg form
   4b) Koha sends verification email to patron to verify email
   4c) Patron clicks verification link in notice
   4d) Koha sends notice to library to review registration
   4e) Library approves reg by clicking verification link in notice
   4f) Patron account created
   4g) Password reset link emailed to patron

-----------

Test plan (in each test plan step where you must fill in OPAC self reg form
please
use a different email address):

1. Apply patch and restart plack
2. Update database:
cd installer/data/mysql
sudo koha-shell <instancename>
./updatedatabase.pl
3. Observe 2 new sysprefs in same line in editor (and observe
PatronSelfRegistrationVerifyByEmail syspref has been removed):
* PatronSelfRegistrationVerifyByEmailToLibrary - Set to 'None' by
default
* PatronSelfRegistrationVerifyByEmailToPatron - Set to "Don't require"
by default. (Exception: If PatronSelfRegistrationVerifyByEmail
syspref was enabled before applying this patch then
PatronSelfregistrationVerifyByEmailToPatron will now be enabled).

[Test scenario 1]

4. Set the following sysprefs:
* PatronSelfRegistration - enabled
* OpacResetPassword - enabled
* PatronSelfRegistrationVerifyByEmailToLibrary - 'None'
* PatronSelfRegistrationVerifyByEmailToPatron - "Don't require"

Also set different values in:
* KohaAdminEmailAddress syspref
* ReplyToAddress syspref
* branch email address (Administration > Libraries)

5. Visit OPAC, fill in, submit OPAC registration form
6. Observe your patron account has been created immediately and you can
login

[Test scenario 2]

6. Set PatronSelfRegistrationVerifyByEmailToLibrary to 'email address of
branch'
7. Repeat step 5 and query the database:
select to_address, content from message_queue where
letter_code='STAFF_VER_OPAC_REG';

8. Observe the verification email's to_address is library branch email
address (i.e. set in Administration > Libraries ) and the notice
contains the following information:

* 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

9. Query database again:
select count(*) from borrowers where email=<email entered in reg form>;

select count(*) from borrower_modifications where email=<email entered in reg
form>;

The first query returns 0 (as the patron account has not been added to
borrowers table), the second query has 1 as patron in
borrower_modifications table.

10. Click verification link in notice and query database:
select * from borrowers where email=<email entered in reg form>

11. Observe the patron account has now been added to the borrowers table
12. Query database:
select to_address, content from message_queue where
letter_code='SELF_REG_APPROVED';

13. Observe password reset link emailed to patron, click on the link and
observe the password reset page loads with the patrons username and email
pre-filled

14. Set PatronSelfRegistrationVerifyByEmailToLibrary to
'KohaAdminEmailAddress'

15. Repeat step 7 observing the verification email's to_address is
ReplytoDefault syspref value (if this is not set then
KohaAdminEmailAddress i.e. fallback same as EmailPurchaseSuggestions
syspref).

16. Repeat steps 9, 10, 11, 12, 13 which should all have the same
outcomes

[Test scenario 3]

17. Set PatronSelfRegistrationVerifyByEmailToPatron to "Require"
        PatronSelfRegistrationVerifyByEmailToLibrary to "None"

18. Repeat step 5
19. Query the database with these 4 queries (explanations of what
outputs to expect are hypehnated below each query:

select to_address, content from message_queue
where letter_code='OPAC_REG_VERIFY';

- You'll see 1 new OPAC_REG_VERIFY notice sent to the patrons inputted email

select to_address, content from message_queue
where letter_code='STAFF_VER_OPAC_REG';

- You'll see no new STAFF_VER_OPAC_REG notice generated (because
PatronSelfRegistrationVerifyByEmailToLibrary is set to "None")

select count(*) from borrowers where email=<email entered in reg form>;

- Returns 0 as patron account not added to borrowers table yet

select count(*) from borrower_modifications where email=<email entered
in reg form>;

- Returns 1 as patron account is in borrower_modifications table

20. Click verification link in OPAC_REG_VERIFY notice and query
database:
select count(*) from borrowers where email=<email entered in reg form>

This returns 1 as patron account now in borrowers table

[Test scenario 4]

21. Set PatronSelfRegistrationVerifyByEmailToLibrary = 'email address of
branch'

22. Repeat steps 5 and 19 observing same query outputs

23. Click verification link in OPAC_REG_VERIFY notice

24. Query the database:
select to_address, content from message_queue where
letter_code='OPAC_REG_VERIFY';

- Returns no new OPAC_REG_VERIFY notice

select to_address, content from message_queue where
letter_code='PATRON_AND_LIB_VER';

- This returns a row result.  Note it contains patron details for librarians
to review and the to_address is the library branch email.

select count(*) from borrowers where email=<email entered in reg form>;

- This returns 0 as library still hasn't verified patron account can be
created yet

select count(*) from borrower_modifications where email=<email entered
in reg form>;

- This returns a row result as patron account still in
borrower_modifications table

25. Click on verification link in PATRON_AND_LIB_VERIFY notice

26. Query the database:
select count(*) from borrowers where email=<email entered in reg form>;

- This returns a row result as patron account created

select to_address, content from message_queue where
letter_code='SELF_REG_APPROVED';

- This returns a row result with the to_address being the patrons email.
Click on the password reset link in the notice and observe the password
reset page pre-fills with the patron username and email.

27. 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/

Reply via email to