--- loncom/lonnet/perl/lonnet.pm 2004/11/08 19:19:12 1.564 +++ loncom/lonnet/perl/lonnet.pm 2004/11/10 06:02:11 1.566 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.564 2004/11/08 19:19:12 albertel Exp $ +# $Id: lonnet.pm,v 1.566 2004/11/10 06:02:11 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1188,8 +1188,7 @@ sub ssi_body { my ($filelink,%form)=@_; my $output=($filelink=~/^http\:/?&externalssi($filelink): &ssi($filelink,%form)); - $output=~ - s/\/\/ BEGIN LON\-CAPA Internal.+\/\/ END LON\-CAPA Internal\s//gs; + $output=~s|//(\s*)?\s||gs; $output=~s/^.*?\]*\>//si; $output=~s/(.*)\<\/body\s*\>.*?$/$1/si; return $output; @@ -3781,6 +3780,20 @@ sub diskusage { return $listing; } +sub is_locked { + my ($file_name, $domain, $user) = @_; + my @check; + my $is_locked; + push @check, $file_name; + my %locked = &Apache::lonnet::get('file_permissions',\@check, + $ENV{'user.domain'},$ENV{'user.name'}); + if (ref($locked{$file_name}) eq 'ARRAY') { + $is_locked = 'true'; + } else { + $is_locked = 'false'; + } +} + # ------------------------------------------------------------- Mark as Read Only sub mark_as_readonly { @@ -3800,16 +3813,12 @@ sub get_marked_as_readonly { my %current_permissions = &Apache::lonnet::dump('file_permissions',$domain,$user); my @readonly_files; while (my ($file_name,$value) = each(%current_permissions)) { - &logthis("found $file_name"); if (ref($value) eq "ARRAY"){ - &logthis("found array"); foreach my $stored_what (@{$value}) { if ($stored_what eq $what) { push(@readonly_files, $file_name); - &logthis("defined pushed $file_name"); } elsif (!defined($what)) { push(@readonly_files, $file_name); - &logthis("undef pushed $file_name"); } } }