[LON-CAPA-cvs] cvs: loncom /interface printout.pl
sakharuk
lon-capa-cvs@mail.lon-capa.org
Mon, 20 Oct 2003 17:39:30 -0000
sakharuk Mon Oct 20 13:39:30 2003 EDT
Modified files:
/loncom/interface printout.pl
Log:
Cookie mechanism is implemented. Working on cleanup.
Index: loncom/interface/printout.pl
diff -u loncom/interface/printout.pl:1.38 loncom/interface/printout.pl:1.39
--- loncom/interface/printout.pl:1.38 Thu Oct 16 11:30:43 2003
+++ loncom/interface/printout.pl Mon Oct 20 13:39:30 2003
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# CGI-script to run LaTeX, dvips, ps2ps, ps2pdf etc.
#
-# $Id: printout.pl,v 1.38 2003/10/16 15:30:43 sakharuk Exp $
+# $Id: printout.pl,v 1.39 2003/10/20 17:39:30 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -26,12 +26,36 @@
# http://www.lon-capa.org/
#
+use lib '/home/httpd/lib/perl';
+use LONCAPA::loncgi();
use File::Path;
use IO::File;
use Image::Magick;
+
+if (! &LONCAPA::loncgi::check_cookie_and_load_env()) {
+ print <<END;
+Content-type: text/html
+
+<html>
+<head><title>Bad Cookie</title></head>
+<body>
+Your cookie information is incorrect. What\'s up with that?
+</body>
+</html>
+END
+ return;
+}
+
print "Content-type: text/html\n\n";
print "<body bgcolor=\"#FFFFFF\">\n";
- my ($texfile,$laystyle,$numberofcolumns,$selectionmade) = split(/&/,$ENV{'QUERY_STRING'});
+#### my ($texfile,$laystyle,$numberofcolumns,$selectionmade) = split(/&/,$ENV{'QUERY_STRING'});
+
+my $identifier = $ENV{'QUERY_STRING'};
+my $texfile = $ENV{$identifier.'.file'};
+my $laystyle = $ENV{$identifier.'.layout'};
+my $numberofcolumns = $ENV{$identifier.'.numcol'};
+my $selectionmade = $ENV{$identifier.'.selection'};
+
my $advans_role=0;
if ($selectionmade>=10000) {$selectionmade=$selectionmade/10000; $advans_role=1;}
my $figfile = $texfile;