diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl
index 6d5a959619..bd05e6f42c 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl
@@ -132,6 +132,9 @@
Date of expiration is invalid.
+
+ Password must be at least characters long.
+
The attribute value
is already is use by another patron record.
@@ -825,7 +828,7 @@
- Required
+ RequiredMinimum password length:
diff --git a/members/memberentry.pl b/members/memberentry.pl
index dba1818c01..16fde6fe5d 100755
--- a/members/memberentry.pl
+++ b/members/memberentry.pl
@@ -84,6 +84,9 @@ my $userenv = C4::Context->userenv;
$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);
@@ -212,6 +215,9 @@ if ($op eq 'save' || $op eq 'insert'){
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);