--- loncom/interface/printout.pl 2005/05/03 22:22:47 1.80
+++ loncom/interface/printout.pl 2024/10/21 19:32:10 1.175
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# CGI-script to run LaTeX, dvips, ps2ps, ps2pdf etc.
#
-# $Id: printout.pl,v 1.80 2005/05/03 22:22:47 albertel Exp $
+# $Id: printout.pl,v 1.175 2024/10/21 19:32:10 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -29,79 +29,53 @@
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;
-# Get the list of course coordinators authorized on this course:
-#Parameters:
-# id - Course id.
-# dom - Domain of course.
-#Returns:
-# A (possibly empty) list of course coordinators. Each course coordinator
-# is given as user:domain
-#
-sub get_cc_list {
- my ($id, $dom) = @_;
- my @personel = &Apache::lonnet::getkeys('nohist_userroles', $dom, $id);
- my @coordinators;
- foreach my $person (@personel) {
- my @info = split(/:/, $person);
- my $role = $info[0];
- my $user = $info[1];
- my $udom = $info[2];
- if ($role eq 'cc') {
- my $isactive = &LONCAPA::Enrollment::check_user_status($udom, $user, $dom, $id, 'cc');
- if ($isactive eq 'ok') {
- push @coordinators, $user.':'.$udom;
- }
- }
+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";
}
- return (@coordinators);
}
-#
+
# Determine if a user is operating as a student for this course/domain.
-#
-#
#Parameters:
-# course - The course id.
-# cdom - The course domain.
-#
+# none
#Implicit:
# $env{request.role} contains the role under which this user operated this
# this request.
sub is_student {
- my ($course, $cdom) = @_;
- my $active_role = $env{'request.role'};
- my @role_fields = split(/\//, $active_role);
-
-
- if ( ($role_fields[0] eq 'st.') && ($role_fields[1] eq $cdom) &&
- ($role_fields[2] eq $course)) {
- return 1;
- } else {
- return 0;
- }
-
-
+ return ($env{'request.role'}=~/^st\./);
}
#
# Debugging: Dump the environment for debugging.
#
sub dumpenv {
- print "
-------------------
"; + print "-------------------
"; + print "