From 912a97f8b49b89d03ed524bed2072db0a50c4527 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 5 Apr 2019 15:13:36 -0300 Subject: [PATCH] Bug 22068: (QA follow-up) Return meaningful error codes Signed-off-by: Tomas Cohen Arazi Signed-off-by: Nick Clemens (cherry picked from commit e98dacf9f1f8464f0db394da6bc1152f96713597) Signed-off-by: Martin Renvoize --- opac/opac-article-request-cancel.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(); } -- 2.39.5