--- rat/lonpageflip.pm 2004/10/19 15:26:53 1.49 +++ rat/lonpageflip.pm 2004/11/11 19:43:22 1.50 @@ -2,7 +2,7 @@ # # Page flip handler # -# $Id: lonpageflip.pm,v 1.49 2004/10/19 15:26:53 albertel Exp $ +# $Id: lonpageflip.pm,v 1.50 2004/11/11 19:43:22 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -82,6 +82,14 @@ sub fullmove { return($rid,$mapurl); } +sub hash_src { + my ($id)=@_; + if ($hash{'encrypted_'.$id}) { + return &Apache::lonenc::encrypted($hash{'src_'.$id}); + } + return $hash{'src_'.$id}; +} + sub move { my ($rid,$mapurl,$direction)=@_; my $startoutrid=$rid; @@ -198,6 +206,9 @@ sub handler { $ENV{'form.postdata'}=~/(\w+)\:(.*)/; my $direction=$1; my $currenturl=$2; + if ($currenturl=~m|^/enc/|) { + $currenturl=&Apache::lonenc::unencrypted($currenturl); + } $currenturl=~s/\.\d+\.(\w+)$/\.$1/; if ($direction eq 'return') { # -------------------------------------------------------- Return to last known @@ -213,9 +224,15 @@ sub handler { my ($murl,$fn)=&Apache::lonnet::decode_symb($last); my $id; ($murl,$id,$fn)=&Apache::lonnet::decode_symb(&Apache::lonnet::symbread($fn)); - $newloc=$hash{'src_'. - $hash{'map_pc_'.&Apache::lonnet::clutter($murl)}.'.'.$id}; - unless ($newloc) { $newloc='/adm/noidea.html'; } + $id=$hash{'map_pc_'.&Apache::lonnet::clutter($murl)}.'.'.$id; + $newloc=$hash{'src_'.$id}; + &Apache::lonnet::logthis(" hrrm 1 "); + if ($newloc) { + if ($hash{'encrypted_'.$id}) { $newloc=&Apache::lonenc::encrypted($newloc); } + + } else { + $newloc='/adm/noidea.html'; + } untie %hash; } else { $newloc='/adm/noidea.html'; @@ -280,7 +297,7 @@ sub handler { @possibilities=split(/\,/,$next); if ($#possibilities==0) { # ---------------------------------------------- Only one possibility, redirect - $redirecturl=$hash{'src_'.$next}; + $redirecturl=&hash_src($next); $cachehash{$endupmap} {&Apache::lonnet::declutter($redirecturl)} =(split(/\./,$next))[1];