[Koha-patches] [PATCH] Bug 2662: make rand password consider minPasswordLength pref

Nicole Engard nengard at gmail.com
Fri Dec 18 15:09:02 CET 2009


---
 members/member-password.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/members/member-password.pl b/members/member-password.pl
index 071a5fa..67f96db 100755
--- a/members/member-password.pl
+++ b/members/member-password.pl
@@ -73,7 +73,7 @@ if ( $newpassword  && ! $errormsg ) {
     my $userid = $bor->{'userid'};
 
     my $chars='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
-    my $length=int(rand(2))+4;
+    my $length=int(rand(2))+C4::Context->preference("minPasswordLength");
     my $defaultnewpassword='';
     for (my $i=0; $i<$length; $i++) {
 	$defaultnewpassword.=substr($chars, int(rand(length($chars))),1);
-- 
1.5.6.5




More information about the Koha-patches mailing list