Bugzilla – Attachment 41457 Details for
Bug 14589
Adjust authorities_merge_ajax and replace some indirect syntax
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14589: Replace fetch CGI::Cookie calls
Bug-14589-Replace-fetch-CGICookie-calls.patch (text/plain), 6.97 KB, created by
Marcel de Rooy
on 2015-08-12 09:07:22 UTC
(
hide
)
Description:
Bug 14589: Replace fetch CGI::Cookie calls
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-08-12 09:07:22 UTC
Size:
6.97 KB
patch
obsolete
>From 3af8abc8a85bf12c6233a1a3a116d12a2bc56360 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 22 Jul 2015 14:41:42 +0200 >Subject: [PATCH] Bug 14589: Replace fetch CGI::Cookie calls >Content-Type: text/plain; charset=utf-8 > >This patch is inspired by the change in bug 14588. >It replaces the indirect object syntax for CGI::Cookie. >Some trivial corrections are made to authorities/merge_ajax.pl just as >bug 14588 does for cataloguing. > >Test plan: >Run the URL authorities/merge_ajax.pl in staff. >Upload a file with Stage MARC records for import. >--- > acqui/check_duplicate_barcode_ajax.pl | 2 +- > authorities/merge_ajax.pl | 12 +++++------- > opac/opac-patron-image.pl | 2 +- > opac/opac-ratings-ajax.pl | 2 +- > opac/opac-tags.pl | 2 +- > tags/review.pl | 2 +- > tools/background-job-progress.pl | 6 +++--- > tools/upload-file-progress.pl | 5 ++--- > tools/upload-file.pl | 2 +- > 9 files changed, 16 insertions(+), 19 deletions(-) > >diff --git a/acqui/check_duplicate_barcode_ajax.pl b/acqui/check_duplicate_barcode_ajax.pl >index 6a05814..fcd85fe 100755 >--- a/acqui/check_duplicate_barcode_ajax.pl >+++ b/acqui/check_duplicate_barcode_ajax.pl >@@ -30,7 +30,7 @@ my $input = new CGI; > print $input->header('application/json'); > > # Check the user's permissions >-my %cookies = fetch CGI::Cookie; >+my %cookies = CGI::Cookie->fetch; > my $sessid = $cookies{'CGISESSID'}->value || $input->param('CGISESSID'); > my ($auth_status, $auth_sessid) = C4::Auth::check_cookie_auth($sessid, {acquisition => 'order_manage'}); > if ($auth_status ne "ok") { >diff --git a/authorities/merge_ajax.pl b/authorities/merge_ajax.pl >index 458b4c9..f5c9ef2 100755 >--- a/authorities/merge_ajax.pl >+++ b/authorities/merge_ajax.pl >@@ -4,23 +4,21 @@ use strict; > use warnings; > > use CGI qw ( -utf8 ); >-use CGI::Session; >+use CGI::Cookie; # need to check cookies before CGI parses the POST request >+use JSON; >+ > use C4::Context; > use C4::Auth qw/check_cookie_auth/; > use C4::AuthoritiesMarc; >-use JSON; >-use CGI::Cookie; # need to check cookies before >- # having CGI parse the POST request > >-my %cookies = fetch CGI::Cookie; >+my %cookies = CGI::Cookie->fetch; > my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { editcatalogue => 'edit_catalogue' }); >+my $reply = CGI::->new; > if ($auth_status ne "ok") { >- my $reply = CGI->new(""); > print $reply->header(-type => 'text/html'); > exit 0; > } > >-my $reply = new CGI; > my $framework = $reply->param('frameworkcode'); > my $tagslib = GetTagsLabels(1, $framework); > print $reply->header(-type => 'text/html'); >diff --git a/opac/opac-patron-image.pl b/opac/opac-patron-image.pl >index 993969f..0845bf1 100755 >--- a/opac/opac-patron-image.pl >+++ b/opac/opac-patron-image.pl >@@ -33,7 +33,7 @@ unless (C4::Context->preference('OPACpatronimages')) { > } > > my $needed_flags; >-my %cookies = fetch CGI::Cookie; >+my %cookies = CGI::Cookie->fetch; > my $sessid = $cookies{'CGISESSID'}->value; > my ($auth_status, $auth_sessid) = check_cookie_auth($sessid, $needed_flags); > my $borrowernumber = C4::Context->userenv->{'number'}; >diff --git a/opac/opac-ratings-ajax.pl b/opac/opac-ratings-ajax.pl >index 97a5aa1..1b91caf 100755 >--- a/opac/opac-ratings-ajax.pl >+++ b/opac/opac-ratings-ajax.pl >@@ -106,7 +106,7 @@ exit; > # a ratings specific ajax return sub, returns CGI object, and an 'auth_success' value > sub ajax_auth_cgi { > my $needed_flags = shift; >- my %cookies = fetch CGI::Cookie; >+ my %cookies = CGI::Cookie->fetch; > my $input = CGI->new; > my $sessid = $cookies{'CGISESSID'}->value || $input->param('CGISESSID'); > my ( $auth_status, $auth_sessid ) = >diff --git a/opac/opac-tags.pl b/opac/opac-tags.pl >index f41fae7..233991f 100755 >--- a/opac/opac-tags.pl >+++ b/opac/opac-tags.pl >@@ -57,7 +57,7 @@ my @globalErrorIndexes = (); > > sub ajax_auth_cgi { # returns CGI object > my $needed_flags = shift; >- my %cookies = fetch CGI::Cookie; >+ my %cookies = CGI::Cookie->fetch; > my $input = CGI->new; > my $sessid = $cookies{'CGISESSID'}->value; > my ($auth_status, $auth_sessid) = check_cookie_auth($sessid, $needed_flags); >diff --git a/tags/review.pl b/tags/review.pl >index 4756672..53e1b28 100755 >--- a/tags/review.pl >+++ b/tags/review.pl >@@ -39,7 +39,7 @@ my $needed_flags = { tools => 'moderate_tags' }; # FIXME: replace when more spec > > sub ajax_auth_cgi ($) { # returns CGI object > my $needed_flags = shift; >- my %cookies = fetch CGI::Cookie; >+ my %cookies = CGI::Cookie->fetch; > my $input = CGI->new; > my $sessid = $cookies{'CGISESSID'}->value; > my ($auth_status, $auth_sessid) = check_cookie_auth($sessid, $needed_flags); >diff --git a/tools/background-job-progress.pl b/tools/background-job-progress.pl >index a5fc47d..2fdb85c 100755 >--- a/tools/background-job-progress.pl >+++ b/tools/background-job-progress.pl >@@ -30,8 +30,8 @@ use C4::BackgroundJob; > use CGI::Cookie; # need to check cookies before > # having CGI parse the POST request > >-my $input = new CGI; >-my %cookies = fetch CGI::Cookie; >+my $input = CGI::->new; >+my %cookies = CGI::Cookie->fetch; > my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { tools => '*' }); > if ($auth_status ne "ok") { > my $reply = CGI->new(""); >@@ -51,7 +51,7 @@ if (defined $job) { > $job_status = $job->status(); > } > >-my $reply = CGI->new(""); >+my $reply = CGI::->new; > print $reply->header(-type => 'text/html'); > # response will be sent back as JSON > print '{"progress":"' . $reported_progress . '","job_size":"' . $job_size . '","job_status":"' . $job_status . '"}'; >diff --git a/tools/upload-file-progress.pl b/tools/upload-file-progress.pl >index 91af827..cdb940b 100755 >--- a/tools/upload-file-progress.pl >+++ b/tools/upload-file-progress.pl >@@ -36,7 +36,7 @@ my $flags_required = [ > {tools => 'upload_local_cover_images'}, > ]; > >-my %cookies = fetch CGI::Cookie; >+my %cookies = CGI::Cookie->fetch; > > my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value); > >@@ -47,8 +47,8 @@ foreach my $flag_required ( @{$flags_required} ) { > } > } > >+my $reply = CGI::->new; > if ($auth_failure) { >- my $reply = CGI->new(""); > print $reply->header(-type => 'text/html'); > print '{"progress":"0"}'; > exit 0; >@@ -56,7 +56,6 @@ if ($auth_failure) { > > my $reported_progress = C4::UploadedFile->upload_progress($sessionID); > >-my $reply = CGI->new(""); > print $reply->header(-type => 'text/html'); > # response will be sent back as JSON > print '{"progress":"' . $reported_progress . '"}'; >diff --git a/tools/upload-file.pl b/tools/upload-file.pl >index 94a33a6..7ddedaa 100755 >--- a/tools/upload-file.pl >+++ b/tools/upload-file.pl >@@ -44,7 +44,7 @@ my $flags_required = [ > {tools => 'upload_local_cover_images'} > ]; > >-my %cookies = fetch CGI::Cookie; >+my %cookies = CGI::Cookie->fetch; > > my $auth_failure = 1; > my ( $auth_status, $sessionID ) = check_cookie_auth( $cookies{'CGISESSID'}->value ); >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14589
:
41125
|
41457
|
41675
|
41691
|
41882
|
41883
|
44177
|
44187