--- loncom/lontrans.pm 2006/08/17 20:22:11 1.12 +++ loncom/lontrans.pm 2006/12/06 22:22:36 1.13 @@ -1,7 +1,7 @@ # The LearningOnline Network # URL translation for User Files # -# $Id: lontrans.pm,v 1.12 2006/08/17 20:22:11 albertel Exp $ +# $Id: lontrans.pm,v 1.13 2006/12/06 22:22:36 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,7 +32,6 @@ use strict; use Apache::Constants qw(:common :remotehost); use Apache::lonnet(); use Apache::File(); -use lib '/home/httpd/lib/perl'; use LONCAPA; @@ -50,14 +49,14 @@ sub handler { my @ids=&Apache::lonnet::current_machine_ids(); foreach my $id (@ids) { if ($id eq $chome) { $allowed=1; } } if ($allowed) { - $r->filename(&propath($udom,$uname). - '/userfiles/'.(join('/',@ufile))); + $r->filename(&propath($udom,$uname). + '/userfiles/'.(join('/',@ufile))); } } elsif ($r->uri=~m|^/~|) { #internal authentication, needs fixup. my $fn = $r->uri(); # non users do not get the full path request # through SCRIPT_FILENAME - $fn=~s|^/~(\w+)|/home/$1/public_html|; + $fn=~s|^/~($LONCAPA::username_re)|/home/$1/public_html|; $r->filename($fn); } else { return DECLINED; } return OK;