--- loncom/lonnet/perl/lonnet.pm 2004/09/20 19:54:47 1.543 +++ loncom/lonnet/perl/lonnet.pm 2004/09/22 20:43:20 1.546 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.543 2004/09/20 19:54:47 albertel Exp $ +# $Id: lonnet.pm,v 1.546 2004/09/22 20:43:20 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -821,7 +821,7 @@ sub getsection { } -my $disk_caching_disabled=1; +my $disk_caching_disabled=0; sub devalidate_cache { my ($cache,$id,$name) = @_; @@ -927,6 +927,9 @@ sub save_cache { eval <<'EVALBLOCK'; $hash{$id.'.time'}=$$cache{$id.'.time'}; $hash{$id}=freeze({'item'=>$$cache{$id}}); + if (exists($$cache{$id.'.file'})) { + $hash{$id.'.file'}=freeze({'item'=>$$cache{$id.'.file'}}); + } EVALBLOCK if ($@) { &logthis("save_cache blew up :$@:$name"); @@ -977,8 +980,14 @@ sub load_cache_item { } else { if (($$cache{$id.'.time'}+$time) < time) { $$cache{$id.'.time'}=$hash{$id.'.time'}; - my $hashref=thaw($hash{$id}); - $$cache{$id}=$hashref->{'item'}; + { + my $hashref=thaw($hash{$id}); + $$cache{$id}=$hashref->{'item'}; + } + if (exists($hash{$id.'.file'})) { + my $hashref=thaw($hash{$id.'.file'}); + $$cache{$id.'.file'}=$hashref->{'item'}; + } } } EVALBLOCK @@ -2765,7 +2774,9 @@ sub allowed { $uri=&deversion($uri); my $orguri=$uri; $uri=&declutter($uri); - + + + if (defined($ENV{'allowed.'.$priv})) { return $ENV{'allowed.'.$priv}; } # Free bre access to adm and meta resources if (((($uri=~/^adm\//) && ($uri !~ m|/bulletinboard$|)) @@ -2773,6 +2784,13 @@ sub allowed { return 'F'; } +# Free bre access to user's own portfolio contents + my ($space,$domain,$name,$dir)=split('/',$uri); + if (('uploaded' eq $space) && ($ENV{'user.name'} eq $name) && + ($ENV{'user.domain'} eq $domain) && ('portfolio' eq $dir)) { + return 'F'; + } + # Free bre to public access if ($priv eq 'bre') {