X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=members%2Fmancredit.pl;h=014d82248689bc39e5e61df8baf7c064dad7a1d3;hb=3c2cc8da26f7a907c0b51f928ffb100eefbfa692;hp=7c5ec3c6033254f170de75b56b5b8630508cad02;hpb=0693052bfcd0b4259eb620233550f81eab49eabd;p=koha.git diff --git a/members/mancredit.pl b/members/mancredit.pl index 7c5ec3c603..014d822486 100755 --- a/members/mancredit.pl +++ b/members/mancredit.pl @@ -62,7 +62,7 @@ my $add = $input->param('add'); if ($add){ - die "Wrong CSRF token" + output_and_exit( $input, $cookie, $template, 'wrong_csrf_token' ) unless Koha::Token->new->check_csrf( { session_id => scalar $input->cookie('CGISESSID'), token => scalar $input->param('csrf_token'), @@ -81,10 +81,13 @@ if ($add){ my $amount = $input->param('amount') || 0; my $type = $input->param('type'); + my $library_id = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; + $patron->account->add_credit({ amount => $amount, description => $description, item_id => $item_id, + library_id => $library_id, note => $note, type => $type, user_id => $logged_in_user->id