--- loncom/lontrans.pm 2006/01/16 19:27:09 1.10 +++ loncom/lontrans.pm 2020/03/05 22:02:32 1.14.10.1 @@ -1,7 +1,7 @@ # The LearningOnline Network # URL translation for User Files # -# $Id: lontrans.pm,v 1.10 2006/01/16 19:27:09 albertel Exp $ +# $Id: lontrans.pm,v 1.14.10.1 2020/03/05 22:02:32 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,10 +32,13 @@ use strict; use Apache::Constants qw(:common :remotehost); use Apache::lonnet(); use Apache::File(); -use Apache::loncommon; +use LONCAPA; + sub handler { my $r = shift; + # FIXME line remove when mod_perl fixes BUG#4948 + $r->notes->set('error-notes' => ''); if ($r->uri=~m|^(/raw)?/uploaded/|) { my $fn = $r->uri(); $fn=~s/^\/raw//; @@ -46,17 +49,16 @@ sub handler { 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))); + $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|; - $r->filename($fn); - } else { return DECLINED; } - return OK; + return OK; + } elsif ($r->uri =~ m{^\Q/adm/wrapper/ext/https:/\E[^/]}) { + my $uri = $r->uri; + $uri =~ s{^(\Q/adm/wrapper/ext/https:/\E)}{$1/}; + $r->uri($uri); + } + return DECLINED; } 1;