X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=members%2Fmember-password.pl;h=0fefe4fa670d2818f53b1d49dcb019531d2aaaf1;hb=700249eb3cbf765a5a731effd21ba543b74eb334;hp=696a4369daafc2f7687cad99ffad2f27d74e124a;hpb=f1f833c96568284552dae2b12f14229ef5c991bc;p=koha_fer diff --git a/members/member-password.pl b/members/member-password.pl index 696a4369da..0fefe4fa67 100755 --- a/members/member-password.pl +++ b/members/member-password.pl @@ -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,6 +101,7 @@ $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'},