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") {
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');
}
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'};
# 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 ) =
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);
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);
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("");
$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 . '"}';