--- loncom/lonnet/perl/lonnet.pm 2003/10/12 22:02:44 1.430 +++ loncom/lonnet/perl/lonnet.pm 2003/10/27 21:59:34 1.433 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.430 2003/10/12 22:02:44 www Exp $ +# $Id: lonnet.pm,v 1.433 2003/10/27 21:59:34 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -274,10 +274,19 @@ sub transfer_profile_to_env { $idf->close(); } my $envi; + my %Remove; for ($envi=0;$envi<=$#profile;$envi++) { chomp($profile[$envi]); my ($envname,$envvalue)=split(/=/,$profile[$envi]); $ENV{$envname} = $envvalue; + if (my ($key,$time) = ($envname =~ /^(cgi\.(\d+)_\d+\.)/)) { + if ($time < time-300) { + $Remove{$key}++; + } + } + } + foreach my $expired_key (keys(%Remove)) { + &delenv($expired_key); } $ENV{'user.environment'} = "$lonidsdir/$handle.id"; } @@ -3848,18 +3857,25 @@ sub metadata { $lcmetacache{':packages'}=$package.$keyroot; } foreach (keys %packagetab) { - if ($_=~/^$package\&/) { + my $part=$keyroot; + $part=~s/^\_//; + if ($_=~/^\Q$package\E\&/ || + $_=~/^\Q$package\E_0\&/) { my ($pack,$name,$subp)=split(/\&/,$_); # ignore package.tab specified default values # here &package_tab_default() will fetch those if ($subp eq 'default') { next; } my $value=$packagetab{$_}; - my $part=$keyroot; - $part=~s/^\_//; + my $unikey; + if ($pack =~ /_0$/) { + $unikey='parameter_0_'.$name; + $part=0; + } else { + $unikey='parameter'.$keyroot.'_'.$name; + } if ($subp eq 'display') { $value.=' [Part: '.$part.']'; } - my $unikey='parameter'.$keyroot.'_'.$name; $lcmetacache{':'.$unikey.'.part'}=$part; $metathesekeys{$unikey}=1; unless (defined($lcmetacache{':'.$unikey.'.'.$subp})) { @@ -4037,17 +4053,18 @@ sub symblist { sub symbverify { my ($symb,$thisfn)=@_; - $thisfn=&declutter($thisfn); + $thisfn=&symbclean(&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 (&symbclean($url) eq &symbclean($thisfn)) { return 0; } + unless ($url eq $thisfn) { return 0; } $symb=&symbclean($symb); my %bighash; my $okay=0; + if (tie(%bighash,'GDBM_File',$ENV{'request.course.fn'}.'.db', &GDBM_READER(),0640)) { my $ids=$bighash{'ids_'.&clutter($thisfn)};