From 9a4220f73d4cf0e5a22c69c6767c99f5819f3049 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 4 Jan 2021 15:46:56 +0100 Subject: [PATCH] Bug 11299: Adjust call to check_cookie_auth Why were we using CGI::Cookie? --- svc/cataloguing/automatic_linker.pl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/svc/cataloguing/automatic_linker.pl b/svc/cataloguing/automatic_linker.pl index 5d7fd0f368..a04ccfb8c9 100755 --- a/svc/cataloguing/automatic_linker.pl +++ b/svc/cataloguing/automatic_linker.pl @@ -19,9 +19,8 @@ use Modern::Perl; use CGI; -use CGI::Cookie; use JSON; -use C4::Auth; +use C4::Auth qw(check_cookie_auth); use C4::Biblio; use C4::Context; @@ -29,10 +28,8 @@ my $input = CGI->new; print $input->header('application/json'); # Check the user's permissions -my %cookies = CGI::Cookie->fetch; -my $sessid = $cookies{'CGISESSID'}->value || $input->param('CGISESSID'); my ( $auth_status, $auth_sessid ) = - C4::Auth::check_cookie_auth( $sessid, { editauthorities => 1, editcatalogue => 1 } ); + C4::Auth::check_cookie_auth( $input->cookie('CGISESSID'), { editauthorities => 1, editcatalogue => 1 } ); if ( $auth_status ne "ok" ) { print to_json( { status => 'UNAUTHORIZED' } ); exit 0; -- 2.11.0