--- loncom/lonnet/perl/lonnet.pm 2012/11/29 20:37:19 1.1201 +++ loncom/lonnet/perl/lonnet.pm 2012/12/03 14:47:37 1.1205 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1201 2012/11/29 20:37:19 raeburn Exp $ +# $Id: lonnet.pm,v 1.1205 2012/12/03 14:47:37 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -10324,7 +10324,8 @@ sub getdocspath { ':'.$res->randompick(). ':'.$res->randomout(). ':'.$res->encrypted(). - ':'.$res->randomorder(); + ':'.$res->randomorder(). + ':'.$res->is_page(); } } } @@ -10339,19 +10340,24 @@ sub getdocspath { ':'.$mapresobj->randompick(). ':'.$mapresobj->randomout(). ':'.$mapresobj->encrypted(). - ':'.$mapresobj->randomorder(); + ':'.$mapresobj->randomorder(). + ':'.$mapresobj->is_page(); } else { my $maptitle = &gettitle($mapurl); + my $ispage; + if ($mapurl =~ /\.page$/) { + $ispage = 1; + } if ($mapurl eq 'default') { $maptitle = 'Main Course Documents'; } $path = &Apache::lonhtmlcommon::entity_encode($mapurl).'&'. - &Apache::lonhtmlcommon::entity_encode($maptitle).'::::'; + &Apache::lonhtmlcommon::entity_encode($maptitle).':::::'.$ispage; } unless ($mapurl eq 'default') { $path = 'default&'. &Apache::lonhtmlcommon::entity_encode('Main Course Documents'). - '::::&'.$path; + ':::::&'.$path; } } return $path; @@ -10504,21 +10510,32 @@ sub symbverify { if (tie(%bighash,'GDBM_File',$env{'request.course.fn'}.'.db', &GDBM_READER(),0640)) { + my $noclutter; if (($thisurl =~ m{^/adm/wrapper/ext/}) || ($thisurl =~ m{^ext/})) { $thisurl =~ s/\?.+$//; + if ($map =~ m{^uploaded/.+\.page$}) { + $thisurl =~ s{^(/adm/wrapper|)/ext/}{http://}; + $thisurl =~ s{^\Qhttp://https://\E}{https://}; + $noclutter = 1; + } + } + my $ids; + if ($noclutter) { + $ids=$bighash{'ids_'.$thisurl}; + } else { + $ids=$bighash{'ids_'.&clutter($thisurl)}; } - my $ids=$bighash{'ids_'.&clutter($thisurl)}; unless ($ids) { my $idkey = 'ids_'.($thisurl =~ m{^/}? '' : '/').$thisurl; $ids=$bighash{$idkey}; } if ($ids) { # ------------------------------------------------------------------- Has ID(s) + if ($thisfn =~ m{^/adm/wrapper/ext/}) { + $symb =~ s/\?.+$//; + } foreach my $id (split(/\,/,$ids)) { my ($mapid,$resid)=split(/\./,$id); - if ($thisfn =~ m{^/adm/wrapper/ext/}) { - $symb =~ s/\?.+$//; - } if ( &symbclean(&declutter($bighash{'map_id_'.$mapid}).'___'.$resid.'___'.$thisfn) eq $symb) { @@ -10529,6 +10546,7 @@ sub symbverify { ($bighash{'encrypted_'.$id} eq $env{'request.enc'}) || ($thisurl eq '/adm/navmaps')) { $okay=1; + last; } } }