@@ -, +, @@ --- basket/sendbasket.pl | 9 +-------- koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasketform.tt | 4 ---- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasketform.tt | 4 ---- opac/opac-sendbasket.pl | 9 +-------- 4 files changed, 2 insertions(+), 24 deletions(-) --- a/basket/sendbasket.pl +++ a/basket/sendbasket.pl @@ -50,19 +50,12 @@ my $email_add = $query->param('email_add'); my $dbh = C4::Context->dbh; -my $csrf_err; if ( $email_add ) { - $csrf_err = 1 unless Koha::Token->new->check_csrf({ + die "Wrong CSRF token" unless Koha::Token->new->check_csrf({ id => C4::Context->userenv->{id}, secret => md5_base64( C4::Context->config('pass') ), token => scalar $query->param('csrf_token'), }); -} - -if( $csrf_err ) { - $template->param( csrf_error => 1, email_add => 1 ); - output_html_with_http_headers $query, $cookie, $template->output; -} elsif ( $email_add ) { my $email = Koha::Email->new(); my %mail = $email->create_message_headers({ to => $email_add }); my $comment = $query->param('comment'); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasketform.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasketform.tt @@ -10,10 +10,6 @@

The cart was sent to: [% email_add |html %]

Close window

[% END %] - [% IF csrf_error %] -

No valid CSRF token!

-

Close window

- [% END %] [% IF ( error ) %]

Problem sending the cart...

[% END %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasketform.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasketform.tt @@ -19,10 +19,6 @@

Close window

[% END %] - [% IF csrf_error %] -

No valid CSRF token!

-

Close window

- [% END %] [% IF ( error ) %]

There was an error sending the cart.

--- a/opac/opac-sendbasket.pl +++ a/opac/opac-sendbasket.pl @@ -52,19 +52,12 @@ my $email_add = $query->param('email_add'); my $dbh = C4::Context->dbh; -my $csrf_err; if ( $email_add ) { - $csrf_err = 1 unless Koha::Token->new->check_csrf({ + die "Wrong CSRF token" unless Koha::Token->new->check_csrf({ id => C4::Context->userenv->{id}, secret => md5_base64( C4::Context->config('pass') ), token => scalar $query->param('csrf_token'), }); -} - -if( $csrf_err ) { - $template->param( csrf_error => 1, email_add => 1 ); - output_html_with_http_headers $query, $cookie, $template->output; -} elsif ( $email_add ) { my $email = Koha::Email->new(); my $user = GetMember(borrowernumber => $borrowernumber); my $user_email = GetFirstValidEmailAddress($borrowernumber) --