diff --git a/opac/opac-article-request-cancel.pl b/opac/opac-article-request-cancel.pl index 0305808a4b..ef9f75345d 100755 --- a/opac/opac-article-request-cancel.pl +++ b/opac/opac-article-request-cancel.pl @@ -41,10 +41,14 @@ my $id = $query->param('id'); if ( $id ) { my $ar = Koha::ArticleRequests->find( $id ); - if ( !$ar || $ar->borrowernumber != $borrowernumber ) { + if ( !$ar ) { print $query->redirect("/cgi-bin/koha/errors/404.pl"); exit; } + elsif ( $ar->borrowernumber != $borrowernumber ) { + print $query->redirect("/cgi-bin/koha/errors/403.pl"); + exit; + } $ar->cancel(); }