Bug 16275

Summary: Prevent patron self registration if the email already filled in borrowers.email
Product: Koha Reporter: Nicolas Legrand <nicolas.legrand>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: bgkriegel, cbrannon, gmcharlt, jonathan.druart, kyle.m.hall, kyle
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12566
Change sponsored?: Sponsored Patch complexity: Medium patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 19366    
Attachments: Bug 16275: Add the new pref PatronSelfRegistrationEmailMustBeUnique
Bug 16275: Do not allow a self registration with an existing email address
[SIGNED-OFF] Bug 16275: Add the new pref PatronSelfRegistrationEmailMustBeUnique
[SIGNED-OFF] Bug 16275: Do not allow a self registration with an existing email address
Bug 16275: Add the new pref PatronSelfRegistrationEmailMustBeUnique
Bug 16275: Do not allow a self registration with an existing email address
[PASSED QA] Bug 16275: Add the new pref PatronSelfRegistrationEmailMustBeUnique
[PASSED QA] Bug 16275: Do not allow a self registration with an existing email address

Description Nicolas Legrand 2016-04-15 13:12:16 UTC
Some of our patrons are not sure they succeed their self registration and self register multiple times. We would like to prevent this by blocking the selfregistration if the field borrowers.email is already filled by the same email address.
Comment 1 Jonathan Druart 2016-04-25 09:02:47 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2016-04-25 09:02:52 UTC Comment hidden (obsolete)
Comment 3 Bernardo Gonzalez Kriegel 2016-04-30 18:05:27 UTC Comment hidden (obsolete)
Comment 4 Bernardo Gonzalez Kriegel 2016-04-30 18:05:35 UTC Comment hidden (obsolete)
Comment 5 Nicolas Legrand 2016-05-04 09:22:58 UTC Comment hidden (obsolete)
Comment 6 Nicolas Legrand 2016-05-04 09:23:06 UTC Comment hidden (obsolete)
Comment 7 Katrin Fischer 2016-07-26 21:38:33 UTC
In general this seems to work nicely without enforcing email verification (PatronSelfRegistrationVerifyByEmail).

I ran into problems testing with email verification, because of bug 16985.

It seems you can register as many patrons as you want with the same e-mail as long as they are not confirmed. I wanted to test to the second patron to use the confirmation link, but can't right now. Jonathan, can you describe what should happen?
Comment 8 Jonathan Druart 2016-08-01 10:45:50 UTC
(In reply to Katrin Fischer from comment #7)
> It seems you can register as many patrons as you want with the same e-mail
> as long as they are not confirmed. I wanted to test to the second patron to
> use the confirmation link, but can't right now. Jonathan, can you describe
> what should happen?

Yes, it is the expected behavior. The test is only done on registered patrons.
Comment 9 Katrin Fischer 2016-08-01 22:38:24 UTC
Created attachment 53862 [details] [review]
[PASSED QA] Bug 16275: Add the new pref PatronSelfRegistrationEmailMustBeUnique

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No errors

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2016-08-01 22:39:16 UTC
Created attachment 53863 [details] [review]
[PASSED QA] Bug 16275: Do not allow a self registration with an existing email address

To avoid multiple registrations, it would be good to check the unicity
of the primary email address.
This patchset adds a new pref PatronSelfRegistrationEmailMustBeUnique.
If on, a patron will get "This email address already exists in our
database" if he try to register with an existing email address.

Test plan:
1/ Register a new patron with an email address
2/ Make an other registration using the same email address
=> With the pref PatronSelfRegistrationEmailMustBeUnique on, you won't be allowed
=> With the pref off, no change should be noticed.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described, no errors.

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Christopher Brannon 2016-08-15 14:18:11 UTC
I am grateful that this is a preference and not a behavior change.  We have many family members that use the same e-mail address for more than one account, and this would make it impossible for them to register more than one family member.
Comment 12 Katrin Fischer 2016-08-15 14:31:36 UTC
It's totally optional - I tested with the option being off as well.
Comment 13 Kyle M Hall (khall) 2016-09-09 12:57:34 UTC
Pushed to master for 16.11, thanks Jonathan!