Bugzilla – Attachment 51065 Details for
Bug 16275
Prevent patron self registration if the email already filled in borrowers.email
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 16275: Do not allow a self registration with an existing email address
SIGNED-OFF-Bug-16275-Do-not-allow-a-self-registrat.patch (text/plain), 3.20 KB, created by
Bernardo Gonzalez Kriegel
on 2016-04-30 18:05:35 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 16275: Do not allow a self registration with an existing email address
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2016-04-30 18:05:35 UTC
Size:
3.20 KB
patch
obsolete
>From f48d0e62ca428877233e86bde8ad6ab72aa427df Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sat, 23 Apr 2016 17:01:24 +0100 >Subject: [PATCH] [SIGNED-OFF] 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. >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt | 3 +++ > opac/opac-memberentry.pl | 9 ++++++++- > 2 files changed, 11 insertions(+), 1 deletion(-) > >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 2dc63f5..f02ff0d 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >@@ -64,6 +64,9 @@ > [% IF field == "password_match" %]<li>Passwords do not match! <a href="#password">password</a></li>[% END %] > [% IF field == "password_invalid" %]<li>Password does not meet minimum requirements! <a href="#password">password</a></li>[% END %] > [% IF field == "password_spaces" %]<li>Password contains leading and/or trailing spaces! <a href="#password">password</a></li>[% END %] >+ [% IF field == "duplicate_email" %] >+ <li>This email address already exists in our database.</li> >+ [% END %] > [% END %] > </ul> > Please correct the errors and resubmit. >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index 75ecdc3..d817f5c 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -323,7 +323,14 @@ sub CheckForInvalidFields { > my $borrower = shift; > my @invalidFields; > if ($borrower->{'email'}) { >- push(@invalidFields, "email") if (!Email::Valid->address($borrower->{'email'})); >+ unless ( Email::Valid->address($borrower->{'email'}) ) { >+ push(@invalidFields, "email"); >+ } elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) { >+ my $patrons_with_same_email = Koha::Patrons->search( { email => $borrower->{email} })->count; >+ if ( $patrons_with_same_email ) { >+ push @invalidFields, "duplicate_email"; >+ } >+ } > } > if ($borrower->{'emailpro'}) { > push(@invalidFields, "emailpro") if (!Email::Valid->address($borrower->{'emailpro'})); >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16275
:
50612
|
50613
|
51064
|
51065
|
51181
|
51182
|
53862
|
53863