--- rat/lonpageflip.pm 2006/10/20 19:42:28 1.72 +++ rat/lonpageflip.pm 2008/11/20 15:19:05 1.77 @@ -2,7 +2,7 @@ # # Page flip handler # -# $Id: lonpageflip.pm,v 1.72 2006/10/20 19:42:28 albertel Exp $ +# $Id: lonpageflip.pm,v 1.77 2008/11/20 15:19:05 jms Exp $ # # Copyright Michigan State University Board of Trustees # @@ -27,6 +27,8 @@ # http://www.lon-capa.org/ # + + package Apache::lonpageflip; use strict; @@ -240,11 +242,17 @@ sub first_accessible_resource { if (tie(%hash,'GDBM_File',$env{'request.course.fn'}.'.db', &GDBM_READER(),0640)) { $furl=$hash{'first_url'}; - if (!&Apache::lonnet::allowed('bre',$furl)) { + my %args; + my ($url,$args) = split(/\?/,$furl); + foreach my $pair (split(/\&/,$args)) { + my ($name,$value) = split(/=/,$pair); + $args{&unescape($name)} = &unescape($value); + } + if (!&Apache::lonnet::allowed('bre',$url,$args{'symb'})) { # Wow, we cannot see this ... move forward to the next one that we can see my ($newrid,$newmap)=&move($hash{'first_rid'},$hash{'first_mapurl'},'forward'); # Build the new URL - my ($newresid,$newmapid)=split(/\./,$newrid); + my ($newmapid,$newresid)=split(/\./,$newrid); my $symb=&Apache::lonnet::encode_symb($newmap,$newresid,$hash{'src_'.$newrid}); $furl=&add_get_param($hash{'src_'.$newrid},{ 'symb' => $symb }); if ($hash{'encrypted_'.$newrid}) { @@ -438,7 +446,7 @@ sub handler { $redirectsymb=''; } } - &Apache::lonnet::appenv('user.criticalcheck.time'=>time); + &Apache::lonnet::appenv({'user.criticalcheck.time'=>time}); } &Apache::loncommon::content_type($r,'text/html'); @@ -522,6 +530,46 @@ ENDMENU 1; __END__ +=pod + +=head1 NAME + +Apache::lonpageflip + +=head1 SYNOPSIS + +Deals with forward, backward, and other page flips. + +This is part of the LearningOnline Network with CAPA project +described at http://www.lon-capa.org. + +=head1 OVERVIEW + +(empty) + +=head1 SUBROUTINES + +=over cleanup() + +=item addrid() + +=item fullmove() + +=item hash_src() + +=item move() + +=item get_next_possible_move() + +=item navlaunch() + +=item first_accessible_resource() + +=item handler() + +=back + +=cut