--- loncom/lontrans.pm 2004/03/31 17:02:51 1.7 +++ loncom/lontrans.pm 2004/07/02 07:58:01 1.9 @@ -1,7 +1,7 @@ # The LearningOnline Network # URL translation for User Files # -# $Id: lontrans.pm,v 1.7 2004/03/31 17:02:51 raeburn Exp $ +# $Id: lontrans.pm,v 1.9 2004/07/02 07:58:01 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,18 +33,19 @@ use Apache::Constants qw(:common :remote use Apache::lonnet(); use Apache::File(); use Apache::loncommon; -use LONCAPA::Configuration; sub handler { my $r = shift; - my $configvars = &LONCAPA::Configuration::read_conf('loncapa.conf'); if ($r->uri=~m|^(/raw)?/uploaded/|) { my $fn = $r->uri(); $fn=~s/^\/raw//; my (undef,undef,$udom,$uname,@ufile)=split(/\//,$fn); $ufile[-1]=~s/^[\~\.]+//; my $chome=&Apache::lonnet::homeserver($uname,$udom); - if ($chome eq $$configvars{'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))); }