--- loncom/lonnet/perl/lonnet.pm 2005/07/26 13:30:34 1.648 +++ loncom/lonnet/perl/lonnet.pm 2005/08/09 16:33:03 1.650 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.648 2005/07/26 13:30:34 raeburn Exp $ +# $Id: lonnet.pm,v 1.650 2005/08/09 16:33:03 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4074,28 +4074,25 @@ sub unmark_as_readonly { my ($tmp)=keys(%current_permissions); if ($tmp=~/^error:/) { undef(%current_permissions); } my @readonly_files = &get_marked_as_readonly($domain,$user,$what); - foreach my $file(@readonly_files){ - my $current_locks = $current_permissions{$file}; + foreach my $file (@readonly_files) { + if (defined($file_name) && ($file_name ne $file)) { next; } + my $current_locks = $current_permissions{$file}; my @new_locks; my @del_keys; if (ref($current_locks) eq "ARRAY"){ foreach my $locker (@{$current_locks}) { my $compare=$locker; if (ref($locker)) { $compare=join('',@{$locker}) }; - if ($compare eq $symb_crs) { - if (defined($file_name) && ($file_name ne $file)) { - push(@new_locks, $what); - } - } else { - push(@new_locks, $what); + if ($compare ne $symb_crs) { + push(@new_locks, $locker); } } - if (@new_locks > 0) { + if (scalar(@new_locks) > 0) { $current_permissions{$file} = \@new_locks; } else { push(@del_keys, $file); &del('file_permissions',\@del_keys, $domain, $user); - delete $current_permissions{$file}; + delete($current_permissions{$file}); } } } @@ -5644,6 +5641,9 @@ sub filelocation { if ($file=~m:^/~:) { # is a contruction space reference $location = $file; $location =~ s:/~(.*?)/(.*):/home/$1/public_html/$2:; + } elsif ($file=~m:^/home/[^/]*/public_html/:) { + # is a correct contruction space reference + $location = $file; } elsif ($file=~/^\/*(uploaded|editupload)/) { # is an uploaded file my ($udom,$uname,$filename)= ($file=~m -^/+(?:uploaded|editupload)/+([^/]+)/+([^/]+)/+(.*)$-);