my $cardnumber = $input->param('cardnumber');
my $userid = $input->param('userid');
+ my ( $is_valid, $passworderror) = Koha::AuthUtils::is_password_valid( $firstpassword );
+
if ( my $error_code = checkcardnumber($cardnumber) ) {
if ( $error_code == 1 ) {
push @messages, { code => 'ERROR_cardnumber_already_exists' };
push @messages, { code => 'ERROR_password_mismatch' };
}
- else {
+ elsif ( $passworderror) {
+ push @messages, { code => 'ERROR_password_too_short'} if $passworderror eq 'too_short';
+ push @messages, { code => 'ERROR_password_too_weak'} if $passworderror eq 'too_weak';
+ push @messages, { code => 'ERROR_password_has_whitespaces'} if $passworderror eq 'has_whitespaces';
+ }
+ else {
my $patron_data = {
surname => scalar $input->param('surname'),
firstname => scalar $input->param('firstname'),
<div class="alert alert-success">Circulation rule created!</div>
[% CASE 'error_on_insert_circ_rule' %]
<div class="alert alert-danger">Circulation rule not created!</div>
+ [% CASE 'ERROR_password_too_short' %]
+ <div class="alert alert-danger">The patron has not been created the entered password was too short</div>
+ [% CASE 'ERROR_password_too_weak' %]
+ <div class="alert alert-danger">The patron has not been created the entered password was too weak, must contain at least one uppercase, and lower case letter and one number</div>
+ [% CASE 'ERROR_password_has_whitespaces' %]
+ <div class="alert alert-danger">The patron has not been created the entered password contained whitespaces</div>
[% CASE %][% message %]
[% END %]
[% END %]