View | Details | Raw Unified | Return to bug 15343
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (-1 / +2 lines)
Lines 61-67 Link Here
61
                                [% IF field == "emailpro" %]<li>Contact information: <a href="#borrower_emailpro">secondary email address</a></li>[% END %]
61
                                [% IF field == "emailpro" %]<li>Contact information: <a href="#borrower_emailpro">secondary email address</a></li>[% END %]
62
                                [% IF field == "B_email" %]<li>Alternate address information: <a href="#borrower_B_email">email address</a></li>[% END %]
62
                                [% IF field == "B_email" %]<li>Alternate address information: <a href="#borrower_B_email">email address</a></li>[% END %]
63
                                [% IF field == "password_match" %]<li>Passwords do not match! <a href="#password">password</a></li>[% END %]
63
                                [% IF field == "password_match" %]<li>Passwords do not match! <a href="#password">password</a></li>[% END %]
64
                                [% IF field == "password_invalid" %]<li>Password does not meet minium requirements! <a href="#password">password</a></li>[% END %]
64
                                [% IF field == "password_invalid" %]<li>Password does not meet minimum requirements! <a href="#password">password</a></li>[% END %]
65
                                [% IF field == "password_spaces" %]<li>Password contains leading and/or trailing spaces! <a href="#password">password</a></li>[% END %]
65
                            [% END %]
66
                            [% END %]
66
                        </ul>
67
                        </ul>
67
                        Please correct the errors and resubmit.
68
                        Please correct the errors and resubmit.
(-)a/opac/opac-memberentry.pl (+3 lines)
Lines 326-331 sub CheckForInvalidFields { Link Here
326
    if ( $borrower->{'password'}  && $minpw && (length($borrower->{'password'}) < $minpw) ) {
326
    if ( $borrower->{'password'}  && $minpw && (length($borrower->{'password'}) < $minpw) ) {
327
       push(@invalidFields, "password_invalid");
327
       push(@invalidFields, "password_invalid");
328
    }
328
    }
329
    if ( $borrower->{'password'} ) {
330
       push(@invalidFields, "password_spaces") if ($borrower->{'password'} =~ /^\s/ or $borrower->{'password'} =~ /\s$/);
331
    }
329
332
330
    return \@invalidFields;
333
    return \@invalidFields;
331
}
334
}
(-)a/t/db_dependent/Members.t (-2 / +4 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 76;
20
use Test::More tests => 77;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Data::Dumper;
22
use Data::Dumper;
23
use C4::Context;
23
use C4::Context;
Lines 371-376 my $password=""; Link Here
371
is( $password =~ /^[a-zA-Z]{10}$/ , 1, 'Test for autogenerated password if none submitted');
371
is( $password =~ /^[a-zA-Z]{10}$/ , 1, 'Test for autogenerated password if none submitted');
372
( $borrowernumber, $password ) = AddMember_Opac(surname=>"Deckard",firstname=>"Rick",password=>"Nexus-6",branchcode => $library2->{branchcode});
372
( $borrowernumber, $password ) = AddMember_Opac(surname=>"Deckard",firstname=>"Rick",password=>"Nexus-6",branchcode => $library2->{branchcode});
373
is( $password eq "Nexus-6", 1, 'Test password used if submitted');
373
is( $password eq "Nexus-6", 1, 'Test password used if submitted');
374
$borrower = GetMember(borrowernumber => $borrowernumber);
375
my $hashed_up =  Koha::AuthUtils::hash_password("Nexus-6", $borrower->{password});
376
is( $borrower->{password} eq $hashed_up, 1, 'Check password hash equals hash of submitted password' );
374
377
375
378
376
379
377
- 

Return to bug 15343