--- loncom/lontrans.pm 2004/04/01 20:18:29 1.8 +++ loncom/lontrans.pm 2006/01/16 19:27:09 1.10 @@ -1,7 +1,7 @@ # The LearningOnline Network # URL translation for User Files # -# $Id: lontrans.pm,v 1.8 2004/04/01 20:18:29 raeburn Exp $ +# $Id: lontrans.pm,v 1.10 2006/01/16 19:27:09 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -40,9 +40,12 @@ sub handler { my $fn = $r->uri(); $fn=~s/^\/raw//; my (undef,undef,$udom,$uname,@ufile)=split(/\//,$fn); - $ufile[-1]=~s/^[\~\.]+//; + if (@ufile) { $ufile[-1]=~s/^[\~\.]+//; } my $chome=&Apache::lonnet::homeserver($uname,$udom); - if ($chome eq $Apache::lonnet::perlvar{'lonHostID'}) { + my $allowed=0; + my @ids=&Apache::lonnet::current_machine_ids(); + foreach my $id (@ids) { if ($id eq $chome) { $allowed=1; } } + if ($allowed) { $r->filename(&Apache::loncommon::propath($udom,$uname). '/userfiles/'.(join('/',@ufile))); }