[LON-CAPA-cvs] cvs: loncom /interface printout.pl

sakharuk lon-capa-cvs@mail.lon-capa.org
Thu, 28 Aug 2003 20:37:26 -0000


sakharuk		Thu Aug 28 16:37:26 2003 EDT

  Modified files:              
    /loncom/interface	printout.pl 
  Log:
  Log and Tex files are available only for advanced users.
  
  
Index: loncom/interface/printout.pl
diff -u loncom/interface/printout.pl:1.35 loncom/interface/printout.pl:1.36
--- loncom/interface/printout.pl:1.35	Thu Aug 28 09:58:35 2003
+++ loncom/interface/printout.pl	Thu Aug 28 16:37:26 2003
@@ -4,6 +4,8 @@
  print "Content-type: text/html\n\n";
  print "<body bgcolor=\"#FFFFFF\">\n";
   my ($texfile,$laystyle,$numberofcolumns,$selectionmade) = split(/&/,$ENV{'QUERY_STRING'});
+  my $advans_role=0;
+  if ($selectionmade>=10000) {$selectionmade=$selectionmade/10000; $advans_role=1;}
   my $figfile = $texfile;
   $figfile =~ s/^([^\.]+printout)[^t]+\.tex/$1\.dat/;
   my $duefile = $texfile;
@@ -87,7 +89,8 @@
 	      if ($sygnal) {
 		  print "$content_of_file[$i]<br />";
 	      }  
-	  } 
+	  }
+          if ($advans_role) {  
               print "<b><big>The link to ";
               $logfilename=~s/\/home\/httpd//;
 	      print "<a href=\"$logfilename\">Your log file </a></big></b>";
@@ -105,6 +108,7 @@
 	      $texfile=~s/\/home\/httpd//;
 	      print "<a href=\"$texfile\">Your original LaTeX file </a></big></b>";
 	      print "\n";
+	  }
 
       } elsif ($body_log_file=~m/<inserted text>/) {
 	  my $whereitbegins = index $body_log_file,'<inserted text>';
@@ -150,24 +154,26 @@
 #	  unlink @garb;
 	      unlink $duefile;
 	      print "<a href=\"/prtspool/$name_file\">Your PDF document</a>";
-	      print "<br /><br />";
-              print "<b><big>The link to ";
-              $logfilename=~s/\/home\/httpd//;
-	      print "<a href=\"$logfilename\">Your log file </a></big></b>";
-	      print "\n";
-              #link tooriginal LaTeX file (included according Michael Hamlin desire)
-	      my $tex_temporary_file=IO::File->new($texfile) || die "Couldn't open file for reading: $!\n";
-	      my @tex_content_of_file = <$tex_temporary_file>;
-	      close $tex_temporary_file; 
-	      my $body_tex_file = join(' ',@tex_content_of_file);
-	      $texfile =~ s/\.tex$/aaaaa\.html/;
-	      $tex_temporary_file = IO::File->new('>'.$texfile); 
-	      print $tex_temporary_file '<html><head><title>LOGFILE</title></head><body><pre>'.$body_tex_file.'</pre></body></html>'."\n";
-	      print "<br /><br />";
-	      print "<b><big>The link to ";
-	      $texfile=~s/\/home\/httpd//;
-	      print "<a href=\"$texfile\">Your original LaTeX file </a></big></b>";
-	      print "\n";
+	      if ($advans_role) {  
+		  print "<br /><br />";
+		  print "<b><big>The link to ";
+		  $logfilename=~s/\/home\/httpd//;
+		  print "<a href=\"$logfilename\">Your log file </a></big></b>";
+		  print "\n";
+		  #link tooriginal LaTeX file (included according Michael Hamlin desire)
+		  my $tex_temporary_file=IO::File->new($texfile) || die "Couldn't open file for reading: $!\n";
+		  my @tex_content_of_file = <$tex_temporary_file>;
+		  close $tex_temporary_file; 
+		  my $body_tex_file = join(' ',@tex_content_of_file);
+		  $texfile =~ s/\.tex$/aaaaa\.html/;
+		  $tex_temporary_file = IO::File->new('>'.$texfile); 
+		  print $tex_temporary_file '<html><head><title>LOGFILE</title></head><body><pre>'.$body_tex_file.'</pre></body></html>'."\n";
+		  print "<br /><br />";
+		  print "<b><big>The link to ";
+		  $texfile=~s/\/home\/httpd//;
+		  print "<a href=\"$texfile\">Your original LaTeX file </a></big></b>";
+		  print "\n";
+	      }
 	  }
       } else {
 	  #LaTeX successfully parsed tex file