Bug 20629: Pass accountline objects to template instead of hashref
[koha.git] / members / member-password.pl
index 374d17a..e886c41 100755 (executable)
@@ -78,10 +78,10 @@ if ( $newpassword and not @errors) {
             token  => scalar $input->param('csrf_token'),
         });
 
-    my $digest = Koha::AuthUtils::hash_password( scalar $input->param('newpassword') );
     my $uid    = $input->param('newuserid') || $bor->{userid};
+    my $password = $input->param('newpassword');
     my $dbh    = C4::Context->dbh;
-    if ( Koha::Patrons->find( $member )->update_password($uid, $digest) ) {
+    if ( Koha::Patrons->find( $member )->update_password($uid, $password) ) {
         $template->param( newpassword => $newpassword );
         if ( $destination eq 'circ' ) {
             print $input->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=$cardnumber");
@@ -95,16 +95,6 @@ if ( $newpassword and not @errors) {
     }
 }
 
-if ( $category_type eq 'C') {
-    my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
-    $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
-    $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
-}
-
-$template->param( adultborrower => 1 ) if ( $category_type =~ /^(A|I)$/ );
-
-$template->param( picture => 1 ) if $patron->image;
-
 if ( C4::Context->preference('ExtendedPatronAttributes') ) {
     my $attributes = GetBorrowerAttributes( $bor->{'borrowernumber'} );
     $template->param(
@@ -114,31 +104,8 @@ if ( C4::Context->preference('ExtendedPatronAttributes') ) {
 }
 
 $template->param(
-    othernames                 => $bor->{'othernames'},
-    surname                    => $bor->{'surname'},
-    firstname                  => $bor->{'firstname'},
-    borrowernumber             => $bor->{'borrowernumber'},
-    cardnumber                 => $bor->{'cardnumber'},
-    categorycode               => $bor->{'categorycode'},
-    category_type              => $category_type,
-    categoryname               => $bor->{'description'},
-    address                    => $bor->{address},
-    address2                   => $bor->{'address2'},
-    streettype                 => $bor->{streettype},
-    city                       => $bor->{'city'},
-    state                      => $bor->{'state'},
-    zipcode                    => $bor->{'zipcode'},
-    country                    => $bor->{'country'},
-    phone                      => $bor->{'phone'},
-    phonepro                   => $bor->{'phonepro'},
-    streetnumber               => $bor->{'streetnumber'},
-    mobile                     => $bor->{'mobile'},
-    email                      => $bor->{'email'},
-    emailpro                   => $bor->{'emailpro'},
-    branchcode                 => $bor->{'branchcode'},
-    userid                     => $bor->{'userid'},
+    patron                     => $patron,
     destination                => $destination,
-    is_child                   => ( $category_type eq 'C' ),
     csrf_token                 => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID'), }),
 );