--- loncom/lonnet/perl/lonnet.pm 2005/10/18 21:27:46 1.665 +++ loncom/lonnet/perl/lonnet.pm 2005/10/18 21:29:35 1.666 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.665 2005/10/18 21:27:46 albertel Exp $ +# $Id: lonnet.pm,v 1.666 2005/10/18 21:29:35 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -5787,14 +5787,15 @@ sub filelocation { sub hreflocation { my ($dir,$file)=@_; unless (($file=~m-^http://-i) || ($file=~m-^/-)) { - my $finalpath=filelocation($dir,$file); - $finalpath=~s-^/home/httpd/html--; - $finalpath=~s-^/home/(\w+)/public_html/-/~$1/-; - return $finalpath; - } elsif ($file=~m-^/home-) { - $file=~s-^/home/httpd/html--; + $file=filelocation($dir,$file); + } + if ($file=~m-^\Q$perlvar{'lonDocRoot'}\E-) { + $file=~s-^\Q$perlvar{'lonDocRoot'}\E--; + } elsif ($file=~m-/home/(\w+)/public_html/-) { $file=~s-^/home/(\w+)/public_html/-/~$1/-; - return $file; + } elsif ($file=~m-^\Q$perlvar{'lonUsersDir'}\E-) { + $file=~s-^/home/httpd/lonUsers/([^/]*)/./././([^/]*)/userfiles/ + -/uploaded/$1/$2/-x; } return $file; }