--- loncom/lonenc.pm 2004/11/10 22:20:50 1.4 +++ loncom/lonenc.pm 2004/11/11 20:05:56 1.5 @@ -1,7 +1,7 @@ # The LearningOnline Network # URL translation for encrypted filenames # -# $Id: lonenc.pm,v 1.4 2004/11/10 22:20:50 albertel Exp $ +# $Id: lonenc.pm,v 1.5 2004/11/11 20:05:56 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -82,6 +82,7 @@ sub unencrypted { pack("H16",substr($uri,$encidx,16)) ); } + $ENV{'request.enc'}=1; return substr($decuri,0,$cmdlength); } @@ -103,6 +104,12 @@ sub encrypted { return '/enc/'.$cmdlength.'/'.&Apache::lonnet::escape($encuri); } +sub check_encrypt { + my $str=shift; + if ($ENV{'request.enc'}) { return &Apache::lonenc::encrypted($str); } + return $str; +} + 1; __END__