--- rat/lonpageflip.pm 2000/10/17 14:23:32 1.9 +++ rat/lonpageflip.pm 2000/10/17 17:49:59 1.10 @@ -61,6 +61,26 @@ sub handler { $ENV{'form.postdata'}=~/(\w+)\:(.*)/; my $direction=$1; my $currenturl=$2; + if ($direction eq 'return') { +# -------------------------------------------------------- Return to last known + my $last; + if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db', + &GDBM_READER,0640)) { + $last=$hash{'last_known'}; + untie(%hash); + } + my $newloc; + if ($last) { + $newloc='/res/'.(split(/\_\_\_/,$last))[1]; + } else { + $newloc='/adm/noidea.html'; + } + $r->content_type('text/html'); + $r->header_out(Location => + 'http://'.$ENV{'HTTP_HOST'}.$newloc); + + return REDIRECT; + } $currenturl=~s/^http\:\/\///; $currenturl=~s/^[^\/]+//; unless ($currenturl=~/\/res\//) { @@ -138,7 +158,7 @@ sub handler { # -------------------------------------------------------------------------- Up } elsif ($direction eq 'down') { # ------------------------------------------------------------------------ Down - } + } # ----------------------------------------------------- Check out possibilities if ($next) { @possibilities=split(/\,/,$next);