|
Lines 30-39
use C4::UploadedFile;
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 %cookies = fetch CGI::Cookie; |
33 |
my %cookies = CGI::Cookie->fetch; |
| 34 |
my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { tools => '*' }); |
34 |
my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { tools => '*' }); |
|
|
35 |
my $reply = CGI::->new; |
| 35 |
if ($auth_status ne "ok") { |
36 |
if ($auth_status ne "ok") { |
| 36 |
my $reply = CGI->new(""); |
|
|
| 37 |
print $reply->header(-type => 'text/html'); |
37 |
print $reply->header(-type => 'text/html'); |
| 38 |
print '{"progress":"0"}'; |
38 |
print '{"progress":"0"}'; |
| 39 |
exit 0; |
39 |
exit 0; |
|
Lines 41-47
if ($auth_status ne "ok") {
Link Here
|
| 41 |
|
41 |
|
| 42 |
my $reported_progress = C4::UploadedFile->upload_progress($sessionID); |
42 |
my $reported_progress = C4::UploadedFile->upload_progress($sessionID); |
| 43 |
|
43 |
|
| 44 |
my $reply = CGI->new(""); |
|
|
| 45 |
print $reply->header(-type => 'text/html'); |
44 |
print $reply->header(-type => 'text/html'); |
| 46 |
# response will be sent back as JSON |
45 |
# response will be sent back as JSON |
| 47 |
print '{"progress":"' . $reported_progress . '"}'; |
46 |
print '{"progress":"' . $reported_progress . '"}'; |