--- loncom/lonnet/perl/lonnet.pm 2003/10/30 22:52:25 1.437 +++ loncom/lonnet/perl/lonnet.pm 2003/11/01 16:37:21 1.439 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.437 2003/10/30 22:52:25 albertel Exp $ +# $Id: lonnet.pm,v 1.439 2003/11/01 16:37:21 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2449,7 +2449,7 @@ sub customaccess { sub allowed { my ($priv,$uri)=@_; - + $uri=&deversion($uri); my $orguri=$uri; $uri=&declutter($uri); @@ -3993,13 +3993,13 @@ sub gettitle { sub symblist { my ($mapname,%newhash)=@_; - $mapname=declutter($mapname); + $mapname=&deversion(&declutter($mapname)); my %hash; if (($ENV{'request.course.fn'}) && (%newhash)) { if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db', &GDBM_WRCREAT(),0640)) { foreach (keys %newhash) { - $hash{declutter($_)}=$mapname.'___'.$newhash{$_}; + $hash{declutter($_)}=$mapname.'___'.&deversion($newhash{$_}); } if (untie(%hash)) { return 'ok'; @@ -4013,14 +4013,16 @@ sub symblist { sub symbverify { my ($symb,$thisfn)=@_; - $thisfn=&symbclean(&declutter($thisfn)); + $thisfn=&declutter($thisfn); # direct jump to resource in page or to a sequence - will construct own symbs if ($thisfn=~/\.(page|sequence)$/) { return 1; } # check URL part my ($map,$resid,$url)=&decode_symb($symb); + unless ($url eq $thisfn) { return 0; } $symb=&symbclean($symb); + $thisfn=&deversion($thisfn); my %bighash; my $okay=0; @@ -4091,6 +4093,12 @@ sub fixversion { return &declutter($uri); } +sub deversion { + my $url=shift; + $url=~s/\.\d+\.(\w+)$/\.$1/; + return $url; +} + # ------------------------------------------------------ Return symb list entry sub symbread {