---
.../prog/en/modules/members/memberentrygen.tmpl | 5 ++++-
members/memberentry.pl | 6 ++++++
2 files changed, 10 insertions(+), 1 deletions(-)
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 98566f6..117357f 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl
@@ -131,6 +131,9 @@
<!-- 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>
@@ -824,7 +827,7 @@
<!-- /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 -->
diff --git a/members/memberentry.pl b/members/memberentry.pl
index dba1818..16fde6f 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);
--
1.5.5.GIT
_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches