--- loncom/interface/printout.pl 2006/04/24 21:31:03 1.94.2.1
+++ loncom/interface/printout.pl 2020/02/18 23:57:54 1.167
@@ -1,6 +1,7 @@
#!/usr/bin/perl
# CGI-script to run LaTeX, dvips, ps2ps, ps2pdf etc.
#
+# $Id: printout.pl,v 1.167 2020/02/18 23:57:54 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -25,24 +26,36 @@
# http://www.lon-capa.org/
#
-BEGIN {
- eval "use Apache2::compat();";
-};
use lib '/home/httpd/lib/perl';
use LONCAPA::loncgi;
use File::Path;
use File::Basename;
+use File::Copy;
use IO::File;
use Image::Magick;
-use Apache::lonhtmlcommon;
+use Apache::lonhtmlcommon();
use Apache::lonnet;
-use Apache::loncommon;
+use Apache::loncommon();
use Apache::lonlocal;
-use Apache::lonmsg;
+use Apache::lonmsg();
use LONCAPA::Enrollment;
+use LONCAPA::Configuration;
+use LONCAPA;
+use Archive::Zip qw( :ERROR_CODES );
use strict;
+my $busy_wait_timeout = 30;
+my $pdfs_converted = 0; # non zero if PDF includes (need to fixps).
+
+my $debugging = 0;
+
+sub debug {
+ if ($debugging) {
+ my ($text) = @_;
+ print "$text
\n";
+ }
+}
# Determine if a user is operating as a student for this course/domain.
#Parameters:
@@ -112,12 +125,12 @@ sub send_error_mail {
if (&is_student()) {
# build the subject and message body:
- # print "sending message to course coordinators.
";
+ &debug("sending message to course coordinators.");
# Todo: Convert badurl into a url from file path:
- my $subject = "Error [$badurl] Print failed for $user".'@'.$domain;
- my $message .= "Print failed to render LaTeX for $user".'@'."$domain\n";
+ my $subject = "Error [$badurl] Print failed for $user".':'.$domain;
+ my $message .= "Print failed to render LaTeX for $user".':'."$domain\n";
$message .= " User was attempting to print: \n";
foreach my $resource (split(/:/,$resources)) {
$message .= " $resource\n";
@@ -129,11 +142,11 @@ sub send_error_mail {
foreach my $line (@$texfile) {
$message .= "$line\n";
}
- my (undef, %receivers) = &Apache::lonfeedback::decide_receiver(undef, 0,
- 1,1,1);
- # print "
sending...section: $env{'request.course.sec'}";
+ my (undef, %receivers) = &Apache::lonmsg::decide_receiver(undef, 0,
+ 1,1,1);
+ &debug("sending...section: $env{'request.course.sec'}");
foreach my $dest (keys %receivers) {
- # print "
dest is $dest";
+ &debug("dest is $dest");
my @destinfo = split(/:/,$dest);
my $user = $destinfo[0];
my $dom = $destinfo[1];
@@ -160,409 +173,376 @@ Your cookie information is incorrect.