version 1.535, 2004/08/27 21:39:54
|
version 1.536, 2004/08/30 18:25:56
|
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 |
if ($file=~/^\/uploaded\/([^\/]+)\/([^\/]+)\/(\/)?simplepage\/([^\/]+)$/) { |
$file=~/^\/uploaded\/([^\/]+)\/([^\/]+)\/(\/)?(.*)$/; |
$location=&Apache::loncommon::propath($1,$2).'/userfiles/simplepage/'.$4; |
my $home=&homeserver($2,$1); |
if (not -e $location) { |
my $allowed=0; |
$file=~/^\/uploaded\/(.*)$/; |
my @ids=¤t_machine_ids(); |
$location=$Apache::lonnet::perlvar{'lonDocRoot'}.'/userfiles/'.$1; |
foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } } |
} |
if ($allowed) { |
} elsif ($file=~/^\/uploaded\/([^\/]+)\/([^\/]+)\/aboutme\/([^\/]+)$/) { |
$location=&Apache::loncommon::propath($1,$2).'/userfiles/'.$4; |
$location=&Apache::loncommon::propath($1,$2).'/userfiles/aboutme/'.$3; |
|
if (not -e $location) { |
|
$file=~/^\/uploaded\/(.*)$/; |
|
$location=$Apache::lonnet::perlvar{'lonDocRoot'}.'/userfiles/'.$1; |
|
} |
|
} else { |
} else { |
$location=$file; |
$location=$Apache::lonnet::perlvar{'lonDocRoot'}.'/userfiles/'.$1.'/'.$2.'/'.$4; |
} |
} |
} else { |
} else { |
$file=~s/^\Q$perlvar{'lonDocRoot'}\E//; |
$file=~s/^\Q$perlvar{'lonDocRoot'}\E//; |