--- rat/lonpage.pm 2004/09/14 01:21:49 1.60 +++ rat/lonpage.pm 2004/12/17 22:34:53 1.66 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Page Handler # -# $Id: lonpage.pm,v 1.60 2004/09/14 01:21:49 raeburn Exp $ +# $Id: lonpage.pm,v 1.66 2004/12/17 22:34:53 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -232,13 +232,21 @@ sub handler { $lcm*=($#colcont+1)/euclid($lcm,($#colcont+1)); foreach (@colcont) { my $src=$hash{'src_'.$_}; - $src=~/\.(\w+)$/; + my ($extension)=($src=~/\.(\w+)$/); + if ($hash{'encrypted_'.$_}) { + $src=&Apache::lonenc::encrypted($src); + } $metalink{$_}=$src.'.meta'; - $cellemb{$_}=Apache::loncommon::fileembstyle($1); + $cellemb{$_}= + &Apache::loncommon::fileembstyle($extension); if ($cellemb{$_} eq 'ssi') { # --------------------------------------------------------- This is an SSI cell + my ($mapid,$resid)=split(/\./,$_); + my $symb=&Apache::lonnet::encode_symb($hash{'map_id_'.$mapid},$resid,$src); + my $prefix=$_.'_'; - my %posthash=('request.prefix' => $prefix); + my %posthash=('request.prefix' => $prefix, + 'symb' => $symb); if ($ENV{'form.grade_target'} eq 'tex') { $posthash{'grade_target'}=$ENV{'form.grade_target'}; $posthash{'textwidth'}=$ENV{'form.textwidth'}; @@ -257,8 +265,7 @@ sub handler { } } my $output=Apache::lonnet::ssi($src,%posthash); - $output=~ - s/\/\/ BEGIN LON\-CAPA Internal.+\/\/ END LON\-CAPA Internal\s//gs; + $output=~s|//(\s*)?\s||gs; if ($target eq 'tex') { $output =~ s/^([^&]+)\\begin{document}//; $output =~ s/\\end{document}//; @@ -397,7 +404,8 @@ sub handler { # ------------------------------------------------------------------ Start form if ($nforms) { $r->print('
'); + &Apache::lonenc::check_encrypt($requrl) + .'">'); } } elsif ($target eq 'tex') { $r->print('\documentclass{article} @@ -413,7 +421,7 @@ sub handler { $r->print('\begin{longtable}INSERTTHEHEADOFLONGTABLE\endfirsthead\endhead '); if ($number_of_columns le $lcm) {$number_of_columns=$lcm;}; } else { - $r->print(''); + $r->print('
'); } for ($i=0;$i<=$#rows;$i++) { if ($rows[$i]) { @@ -425,16 +433,21 @@ sub handler { for ($j=0;$j<=$#colcont;$j++) { my $rid=$colcont[$j]; my $metainfo = ''; - print STDERR "src is $hash{'src_'.$rid}\n"; + my $esrc=&Apache::lonnet::declutter($hash{'src_'.$rid}); + my ($mapid,$resid)=split(/\./,$rid); + my $symb=&Apache::lonnet::encode_symb($hash{'map_id_'.$mapid},$resid,$hash{'src_'.$rid}); + if ($hash{'encrypted_'.$rid}) { + $symb=&Apache::lonenc::encrypted($symb); + $esrc=&Apache::lonenc::encrypted($esrc); + } unless ($hash{'src_'.$rid} =~ m-^/uploaded/-) { - $metainfo =''. + $metainfo =''. ''. ''. ''; } $metainfo .= ''. ''. ''; @@ -545,6 +558,7 @@ sub handler { } else { $r->print('\end{document}'.$number_of_columns); } + &Apache::lonnet::symblist($requrl,%symbhash); # -------------------------------------------------------------------- End page } # ------------------------------------------------------------- End render page 500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.