<!-- TMPL_IF NAME="ERROR_dateexpiry" -->
<li id="ERROR_dateexpiry">Date of expiration is invalid.</li>
<!-- /TMPL_IF -->
+ <!-- TMPL_IF NAME="ERROR_short_password" -->
+ <li id="ERROR_short_password">Password must be at least <!-- TMPL_VAR NAME="minPasswordLength" --> characters long.</li>
+ <!-- /TMPL_IF -->
<!-- TMPL_IF NAME="ERROR_extended_unique_id_failed" -->
<li id="ERROR_extended_unique_id_failed">The attribute value
<!-- TMPL_VAR NAME="ERROR_extended_unique_id_failed" --> is already is use by another patron record.</li>
<!-- /TMPL_IF -->
<!--/TMPL_IF-->
<!--/TMPL_IF-->
- <!-- TMPL_IF NAME="mandatorypassword" --><span class="required">Required</span><!-- /TMPL_IF -->
+ <!-- TMPL_IF NAME="mandatorypassword" --><span class="required">Required</span><!-- /TMPL_IF --><div class="hint">Minimum password length: <!-- TMPL_VAR NAME="minPasswordLength" --></div>
</li></ol>
</fieldset>
<!--this zones are not necessary in modif mode -->
$template->param("uppercasesurnames" => C4::Context->preference('uppercasesurnames'));
+my $minpw = C4::Context->preference('minPasswordLength');
+$template->param("minPasswordLength" => $minpw);
+
# function to designate mandatory fields (visually with css)
my $check_BorrowerMandatoryField=C4::Context->preference("BorrowerMandatoryField");
my @field_check=split(/\|/,$check_BorrowerMandatoryField);
push @errors, "ERROR_login_exist";
$loginexist=1;
}
+
+ my $password = $input->param('password');
+ push @errors, "ERROR_short_password" if( $password && $minpw & (length($password) < $minpw ) );
if (C4::Context->preference('ExtendedPatronAttributes')) {
$extended_patron_attributes = parse_extended_patron_attributes($input);