Diff for /loncom/lonnet/perl/lonnet.pm between versions 1.536 and 1.537

version 1.536, 2004/08/30 18:25:56 version 1.537, 2004/08/31 15:40:49
Line 5056  sub filelocation { Line 5056  sub filelocation {
     $location = $file;      $location = $file;
     $location =~ s:/~(.*?)/(.*):/home/$1/public_html/$2:;      $location =~ s:/~(.*?)/(.*):/home/$1/public_html/$2:;
   } elsif ($file=~/^\/*uploaded/) { # is an uploaded file    } elsif ($file=~/^\/*uploaded/) { # is an uploaded file
       $file=~/^\/uploaded\/([^\/]+)\/([^\/]+)\/(\/)?(.*)$/;        my ($udom,$uname,$filename)=
       my $home=&homeserver($2,$1);    ($file=~m|^/+uploaded/+([^/]+)/+([^/]+)/+(.*)$|);
       my $allowed=0;        my $home=&homeserver($uname,$udom);
         my $is_me=0;
       my @ids=&current_machine_ids();        my @ids=&current_machine_ids();
       foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } }        foreach my $id (@ids) { if ($id eq $home) { $is_me=1; } }
       if ($allowed) {        if ($is_me) {
   $location=&Apache::loncommon::propath($1,$2).'/userfiles/'.$4;    $location=&Apache::loncommon::propath($udom,$uname).
         '/userfiles/'.$filename;
       } else {        } else {
   $location=$Apache::lonnet::perlvar{'lonDocRoot'}.'/userfiles/'.$1.'/'.$2.'/'.$4;    $location=$Apache::lonnet::perlvar{'lonDocRoot'}.'/userfiles/'.
         $udom.'/'.$uname.'/'.$filename;
       }        }
   } else {    } else {
     $file=~s/^\Q$perlvar{'lonDocRoot'}\E//;      $file=~s/^\Q$perlvar{'lonDocRoot'}\E//;

Removed from v.1.536  
changed lines
  Added in v.1.537


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>