Bugzilla – Attachment 47797 Details for
Bug 15343
Allow patrons to choose their own password on self registration.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15343 [QA Followup]
Bug-15343-QA-Followup.patch (text/plain), 3.43 KB, created by
Jonathan Druart
on 2016-02-09 12:10:52 UTC
(
hide
)
Description:
Bug 15343 [QA Followup]
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-02-09 12:10:52 UTC
Size:
3.43 KB
patch
obsolete
>From 84f2b5c443f946c450c5d2c742735ed2a28113d8 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 5 Feb 2016 16:01:17 +0000 >Subject: [PATCH] Bug 15343 [QA Followup] > >* Check for leading/trailing spaces in password >* Check hashed password in tests > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt | 3 ++- > opac/opac-memberentry.pl | 3 +++ > t/db_dependent/Members.t | 5 ++++- > 3 files changed, 9 insertions(+), 2 deletions(-) > >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 7ef1f5ba..0ea468d 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >@@ -61,7 +61,8 @@ > [% IF field == "emailpro" %]<li>Contact information: <a href="#borrower_emailpro">secondary email address</a></li>[% END %] > [% IF field == "B_email" %]<li>Alternate address information: <a href="#borrower_B_email">email address</a></li>[% END %] > [% 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 minium requirements! <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 %] > [% END %] > </ul> > Please correct the errors and resubmit. >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index 66bbb86..3d19846 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -326,6 +326,9 @@ sub CheckForInvalidFields { > if ( $borrower->{'password'} && $minpw && (length($borrower->{'password'}) < $minpw) ) { > push(@invalidFields, "password_invalid"); > } >+ if ( $borrower->{'password'} ) { >+ push(@invalidFields, "password_spaces") if ($borrower->{'password'} =~ /^\s/ or $borrower->{'password'} =~ /\s$/); >+ } > > return \@invalidFields; > } >diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t >index 13e6b57..55bdf82 100755 >--- a/t/db_dependent/Members.t >+++ b/t/db_dependent/Members.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 76; >+use Test::More tests => 77; > use Test::MockModule; > use Data::Dumper; > use C4::Context; >@@ -371,6 +371,9 @@ my $password=""; > is( $password =~ /^[a-zA-Z]{10}$/ , 1, 'Test for autogenerated password if none submitted'); > ( $borrowernumber, $password ) = AddMember_Opac(surname=>"Deckard",firstname=>"Rick",password=>"Nexus-6",branchcode => $library2->{branchcode}); > is( $password eq "Nexus-6", 1, 'Test password used if submitted'); >+$borrower = GetMember(borrowernumber => $borrowernumber); >+my $hashed_up = Koha::AuthUtils::hash_password("Nexus-6", $borrower->{password}); >+is( $borrower->{password} eq $hashed_up, 1, 'Check password hash equals hash of submitted password' ); > > > >-- >2.1.0
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 15343
:
45861
|
45866
|
45867
|
45868
|
45869
|
46705
|
46737
|
47320
|
47321
|
47322
|
47407
|
47408
|
47409
|
47705
|
47794
|
47795
|
47796
| 47797