--- loncom/lonnet/perl/lonnet.pm 2004/09/20 19:54:47 1.543 +++ loncom/lonnet/perl/lonnet.pm 2004/09/21 22:38:10 1.545 @@ -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.545 2004/09/21 22:38:10 banghart 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,12 @@ sub allowed { return 'F'; } +# Free bre access to user's own portfolio contents + $uri=~m:([^/]+)/([^/]+)/([^/]+)/([^/]+)/:; + if (('uploaded' eq $1)&&($ENV{'user.name'} eq $3) && ($ENV{'user.domain'} eq $2) && ('portfolio' eq $4)) { + return 'F'; + } + # Free bre to public access if ($priv eq 'bre') {