From 77e3b58eee730eda4c023a9c867c5c810cd65646 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 21 Sep 2023 10:23:41 +0200 Subject: [PATCH] Bug 34478: op-cud - Adjust C4::Auth code Signed-off-by: Jonathan Druart --- C4/Auth.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index b73e8527e1..757e97e33a 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -1328,7 +1328,14 @@ sub checkauth { my $patron = $userid ? Koha::Patrons->find({ userid => $userid }) : undef; $patron->update_lastseen('login') if $patron; - if ( defined $query->param('op') ) { + my $original_op_cud = $query->param('op-cud'); + if ( $request_method eq 'GET' ) { + $query->param('op-cud', undef); + } elsif ( $request_method eq 'POST' ) { + $query->param('op', undef); + } + + if ( defined $original_op_cud ) { die "Cannot use GET for this request" if $request_method ne 'POST'; -- 2.39.5