[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Mon, 20 Dec 2004 21:52:57 -0000
albertel Mon Dec 20 16:52:57 2004 EDT
Modified files:
/loncom/interface lonprintout.pm
Log:
- splunking
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.342 loncom/interface/lonprintout.pm:1.343
--- loncom/interface/lonprintout.pm:1.342 Mon Dec 20 16:15:20 2004
+++ loncom/interface/lonprintout.pm Mon Dec 20 16:52:57 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.342 2004/12/20 21:15:20 albertel Exp $
+# $Id: lonprintout.pm,v 1.343 2004/12/20 21:52:57 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -838,22 +838,24 @@
if ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'current_document') {
#-- single document - problem, page, html, xml, ...
- my $currentURL;
+ my ($currentURL,$cleanURL);
if ($helper->{'VARS'}->{'construction'} ne '1') {
#prints published resource
$currentURL=$helper->{'VARS'}->{'postdata'};
+ $cleanURL=&Apache::lonenc::check_decrypt($currentURL);
} else {
#prints resource from the construction space
$currentURL='/'.$helper->{'VARS'}->{'filename'};
if ($currentURL=~/([^?]+)/) {$currentURL=$1;}
+ $cleanURL=$currentURL;
}
$selectionmade = 1;
- if ($currentURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
+ if ($cleanURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
my $rndseed=time;
my $texversion='';
if ($helper->{'VARS'}->{'ANSWER_TYPE'} ne 'only') {
my %moreenv;
- $moreenv{'request.filename'}=$currentURL;
+ $moreenv{'request.filename'}=$cleanURL;
if ($helper->{'VARS'}->{'style_file'}=~/\w/) {
$moreenv{'construct.style'}=$helper->{'VARS'}->{'style_file'};
my $dom = $ENV{'user.domain'};
@@ -893,10 +895,10 @@
$texversion=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
if ($helper->{'VARS'}->{'construction'} ne '1') {
$texversion.='\vskip 0 mm \noindent\textbf{'.&Apache::lonnet::gettitle($helper->{'VARS'}->{'symb'}).'}\vskip 0 mm ';
- $texversion.=&path_to_problem ($currentURL,$LaTeXwidth);
+ $texversion.=&path_to_problem($cleanURL,$LaTeXwidth);
} else {
$texversion.='\vskip 0 mm \noindent\textbf{Prints from construction space - there is no title.}\vskip 0 mm ';
- my $URLpath=$currentURL;
+ my $URLpath=$cleanURL;
$URLpath=~s/~([^\/]+)/public_html\/$1\/$1/;
$texversion.=&path_to_problem ($URLpath,$LaTeXwidth);
}
@@ -975,7 +977,7 @@
}
if ($helper->{VARS}->{'construction'} eq '1') {$result=~s/(\\begin{document})/$1 \\fbox\{RANDOM SEED IS $rndseed\} /;}
$result .= '\end{document}';
- } elsif ($currentURL=~/\/(smppg|syllabus|aboutme|bulletinboard)$/) {
+ } elsif ($cleanURL=~/\/(smppg|syllabus|aboutme|bulletinboard)$/) {
my %form;
$form{'grade_target'}='tex';
$form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth);
@@ -1601,7 +1603,8 @@
$helper->{VARS}->{'symb'} = &Apache::lonnet::symbread($helper->{VARS}->{'postdata'});
}
-
+ $helper->{VARS}->{'symb'}=
+ &Apache::lonenc::check_encrypt($helper->{VARS}->{'symb'});
my ($resourceTitle,$sequenceTitle,$mapTitle) = &details_for_menu($helper);
if ($sequenceTitle ne '') {$helper->{VARS}->{'assignment'}=$sequenceTitle;}
@@ -1619,7 +1622,8 @@
0, rindex($helper->{VARS}->{'filename'}, '/') + 1);
} else {
($map, $id, $url) = &Apache::lonnet::decode_symb($symb);
- $helper->{VARS}->{'postdata'} = Apache::lonnet::clutter($url);
+ $helper->{VARS}->{'postdata'} =
+ &Apache::lonenc::check_encrypt(&Apache::lonnet::clutter($url));
if (!$resourceTitle) { # if the resource doesn't have a title, use the filename
my $postdata = $helper->{VARS}->{'postdata'};