View | Details | Raw Unified | Return to bug 14589
Collapse All | Expand All

(-)a/acqui/check_duplicate_barcode_ajax.pl (-1 / +1 lines)
Lines 30-36 my $input = new CGI; Link Here
30
print $input->header('application/json');
30
print $input->header('application/json');
31
31
32
# Check the user's permissions
32
# Check the user's permissions
33
my %cookies = fetch CGI::Cookie;
33
my %cookies = CGI::Cookie->fetch;
34
my $sessid = $cookies{'CGISESSID'}->value || $input->param('CGISESSID');
34
my $sessid = $cookies{'CGISESSID'}->value || $input->param('CGISESSID');
35
my ($auth_status, $auth_sessid) = C4::Auth::check_cookie_auth($sessid, {acquisition => 'order_manage'});
35
my ($auth_status, $auth_sessid) = C4::Auth::check_cookie_auth($sessid, {acquisition => 'order_manage'});
36
if ($auth_status ne "ok") {
36
if ($auth_status ne "ok") {
(-)a/authorities/merge_ajax.pl (-7 / +5 lines)
Lines 4-26 use strict; Link Here
4
use warnings;
4
use warnings;
5
5
6
use CGI qw ( -utf8 );
6
use CGI qw ( -utf8 );
7
use CGI::Session;
7
use CGI::Cookie; # need to check cookies before CGI parses the POST request
8
use JSON;
9
8
use C4::Context;
10
use C4::Context;
9
use C4::Auth qw/check_cookie_auth/;
11
use C4::Auth qw/check_cookie_auth/;
10
use C4::AuthoritiesMarc;
12
use C4::AuthoritiesMarc;
11
use JSON;
12
use CGI::Cookie; # need to check cookies before
13
                 # having CGI parse the POST request
14
13
15
my %cookies = fetch CGI::Cookie;
14
my %cookies = CGI::Cookie->fetch;
16
my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { editcatalogue => 'edit_catalogue' });
15
my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { editcatalogue => 'edit_catalogue' });
16
my $reply = CGI::->new;
17
if ($auth_status ne "ok") {
17
if ($auth_status ne "ok") {
18
    my $reply = CGI->new("");
19
    print $reply->header(-type => 'text/html');
18
    print $reply->header(-type => 'text/html');
20
    exit 0;
19
    exit 0;
21
}
20
}
22
21
23
my $reply = new CGI;
24
my $framework = $reply->param('frameworkcode');
22
my $framework = $reply->param('frameworkcode');
25
my $tagslib = GetTagsLabels(1, $framework);
23
my $tagslib = GetTagsLabels(1, $framework);
26
print $reply->header(-type => 'text/html');
24
print $reply->header(-type => 'text/html');
(-)a/opac/opac-patron-image.pl (-1 / +1 lines)
Lines 33-39 unless (C4::Context->preference('OPACpatronimages')) { Link Here
33
}
33
}
34
34
35
my $needed_flags;
35
my $needed_flags;
36
my %cookies = fetch CGI::Cookie;
36
my %cookies = CGI::Cookie->fetch;
37
my $sessid = $cookies{'CGISESSID'}->value;
37
my $sessid = $cookies{'CGISESSID'}->value;
38
my ($auth_status, $auth_sessid) = check_cookie_auth($sessid, $needed_flags);
38
my ($auth_status, $auth_sessid) = check_cookie_auth($sessid, $needed_flags);
39
my $borrowernumber = C4::Context->userenv->{'number'};
39
my $borrowernumber = C4::Context->userenv->{'number'};
(-)a/opac/opac-ratings-ajax.pl (-1 / +1 lines)
Lines 106-112 exit; Link Here
106
# a ratings specific ajax return sub, returns CGI object, and an 'auth_success' value
106
# a ratings specific ajax return sub, returns CGI object, and an 'auth_success' value
107
sub ajax_auth_cgi {
107
sub ajax_auth_cgi {
108
    my $needed_flags = shift;
108
    my $needed_flags = shift;
109
    my %cookies      = fetch CGI::Cookie;
109
    my %cookies      = CGI::Cookie->fetch;
110
    my $input        = CGI->new;
110
    my $input        = CGI->new;
111
    my $sessid = $cookies{'CGISESSID'}->value || $input->param('CGISESSID');
111
    my $sessid = $cookies{'CGISESSID'}->value || $input->param('CGISESSID');
112
    my ( $auth_status, $auth_sessid ) =
112
    my ( $auth_status, $auth_sessid ) =
(-)a/opac/opac-tags.pl (-1 / +1 lines)
Lines 57-63 my @globalErrorIndexes = (); Link Here
57
57
58
sub ajax_auth_cgi {     # returns CGI object
58
sub ajax_auth_cgi {     # returns CGI object
59
	my $needed_flags = shift;
59
	my $needed_flags = shift;
60
	my %cookies = fetch CGI::Cookie;
60
    my %cookies = CGI::Cookie->fetch;
61
	my $input = CGI->new;
61
	my $input = CGI->new;
62
    my $sessid = $cookies{'CGISESSID'}->value;
62
    my $sessid = $cookies{'CGISESSID'}->value;
63
	my ($auth_status, $auth_sessid) = check_cookie_auth($sessid, $needed_flags);
63
	my ($auth_status, $auth_sessid) = check_cookie_auth($sessid, $needed_flags);
(-)a/tags/review.pl (-1 / +1 lines)
Lines 39-45 my $needed_flags = { tools => 'moderate_tags' }; # FIXME: replace when more spec Link Here
39
39
40
sub ajax_auth_cgi ($) {		# returns CGI object
40
sub ajax_auth_cgi ($) {		# returns CGI object
41
	my $needed_flags = shift;
41
	my $needed_flags = shift;
42
	my %cookies = fetch CGI::Cookie;
42
    my %cookies = CGI::Cookie->fetch;
43
	my $input = CGI->new;
43
	my $input = CGI->new;
44
    my $sessid = $cookies{'CGISESSID'}->value;
44
    my $sessid = $cookies{'CGISESSID'}->value;
45
	my ($auth_status, $auth_sessid) = check_cookie_auth($sessid, $needed_flags);
45
	my ($auth_status, $auth_sessid) = check_cookie_auth($sessid, $needed_flags);
(-)a/tools/background-job-progress.pl (-3 / +3 lines)
Lines 30-37 use C4::BackgroundJob; Link Here
30
use CGI::Cookie; # need to check cookies before
30
use CGI::Cookie; # need to check cookies before
31
                 # having CGI parse the POST request
31
                 # having CGI parse the POST request
32
32
33
my $input = new CGI;
33
my $input = CGI::->new;
34
my %cookies = fetch CGI::Cookie;
34
my %cookies = CGI::Cookie->fetch;
35
my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { tools => '*' });
35
my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { tools => '*' });
36
if ($auth_status ne "ok") {
36
if ($auth_status ne "ok") {
37
    my $reply = CGI->new("");
37
    my $reply = CGI->new("");
Lines 51-57 if (defined $job) { Link Here
51
    $job_status = $job->status();
51
    $job_status = $job->status();
52
}
52
}
53
53
54
my $reply = CGI->new("");
54
my $reply = CGI::->new;
55
print $reply->header(-type => 'text/html');
55
print $reply->header(-type => 'text/html');
56
# response will be sent back as JSON
56
# response will be sent back as JSON
57
print '{"progress":"' . $reported_progress . '","job_size":"' . $job_size . '","job_status":"' . $job_status . '"}';
57
print '{"progress":"' . $reported_progress . '","job_size":"' . $job_size . '","job_status":"' . $job_status . '"}';
(-)a/tools/upload-file-progress.pl (-3 / +2 lines)
Lines 36-42 my $flags_required = [ Link Here
36
     {tools     => 'upload_local_cover_images'},
36
     {tools     => 'upload_local_cover_images'},
37
];
37
];
38
38
39
my %cookies = fetch CGI::Cookie;
39
my %cookies = CGI::Cookie->fetch;
40
40
41
my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value);
41
my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value);
42
42
Lines 47-54 foreach my $flag_required ( @{$flags_required} ) { Link Here
47
    }
47
    }
48
}
48
}
49
49
50
my $reply = CGI::->new;
50
if ($auth_failure) {
51
if ($auth_failure) {
51
    my $reply = CGI->new("");
52
    print $reply->header(-type => 'text/html');
52
    print $reply->header(-type => 'text/html');
53
    print '{"progress":"0"}';
53
    print '{"progress":"0"}';
54
    exit 0;
54
    exit 0;
Lines 56-62 if ($auth_failure) { Link Here
56
56
57
my $reported_progress = C4::UploadedFile->upload_progress($sessionID);
57
my $reported_progress = C4::UploadedFile->upload_progress($sessionID);
58
58
59
my $reply = CGI->new("");
60
print $reply->header(-type => 'text/html');
59
print $reply->header(-type => 'text/html');
61
# response will be sent back as JSON
60
# response will be sent back as JSON
62
print '{"progress":"' . $reported_progress . '"}';
61
print '{"progress":"' . $reported_progress . '"}';
(-)a/tools/upload-file.pl (-2 / +1 lines)
Lines 44-50 my $flags_required = [ Link Here
44
    {tools      => 'upload_local_cover_images'}
44
    {tools      => 'upload_local_cover_images'}
45
];
45
];
46
46
47
my %cookies = fetch CGI::Cookie;
47
my %cookies = CGI::Cookie->fetch;
48
48
49
my $auth_failure = 1;
49
my $auth_failure = 1;
50
my ( $auth_status, $sessionID ) = check_cookie_auth( $cookies{'CGISESSID'}->value );
50
my ( $auth_status, $sessionID ) = check_cookie_auth( $cookies{'CGISESSID'}->value );
51
- 

Return to bug 14589