Bug 6716 - Define reports_dictionary table
[koha_gimpoz] / members / member-password.pl
index f18db80..0fefe4f 100755 (executable)
@@ -5,6 +5,8 @@
 #converted to using templates 3/16/03 by mwhansen@hmc.edu
 
 use strict;
+use warnings;
+
 use C4::Auth;
 use C4::Output;
 use C4::Context;
@@ -38,7 +40,7 @@ my $member=$input->param('member');
 my $cardnumber = $input->param('cardnumber');
 my $destination = $input->param('destination');
 my $errormsg;
-my ($bor)=GetMember($member);
+my ($bor)=GetMember('borrowernumber' => $member);
 if(( $member ne $loggedinuser ) && ($bor->{'category_type'} eq 'S' ) ) {
        $errormsg = 'NOPERMISSION' unless($staffflags->{'superlibrarian'} || $staffflags->{'staffaccess'} );
        # need superlibrarian for koha-conf.xml fakeuser.
@@ -71,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);
@@ -99,7 +101,9 @@ $template->param( picture => 1 ) if $picture;
            address => $bor->{'address'},
            address2 => $bor->{'address2'},
            city => $bor->{'city'},
+           state => $bor->{'state'},
            zipcode => $bor->{'zipcode'},
+           country => $bor->{'country'},
            phone => $bor->{'phone'},
            email => $bor->{'email'},
            branchcode => $bor->{'branchcode'},