--- loncom/interface/lonhelper.pm 2011/10/25 22:27:11 1.184 +++ loncom/interface/lonhelper.pm 2011/11/07 18:22:03 1.187 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # .helper XML handler to implement the LON-CAPA helper # -# $Id: lonhelper.pm,v 1.184 2011/10/25 22:27:11 www Exp $ +# $Id: lonhelper.pm,v 1.187 2011/11/07 18:22:03 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -261,7 +261,7 @@ sub real_handler { my $uri = shift; if (!defined($uri)) { $uri = $r->uri(); } $env{'request.uri'} = $uri; - my $filename = '/home/httpd/html' . $uri; + my $filename = $r->dir_config('lonDocRoot').$uri; my $fh = Apache::File->new($filename); my $file; read $fh, $file, 100000000; @@ -2975,8 +2975,12 @@ BUTTONS # If the subdirectory is in local CSTR space my $metadir; - if ($subdir =~ m|^/home/httpd/html/priv/[^/]+/[^/]+/(.*)$|) { + my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; + if ($subdir =~ m{^(?:\Q$londocroot\E)*/priv/[^/]+/[^/]+/(.*)$}) { my $innerpath=$1; + unless ($subdir=~m{^\Q$londocroot\E}) { + $subdir=$londocroot.$subdir; + } my ($user,$domain)= &Apache::loncacc::constructaccess($subdir); $metadir='/res/'.$domain.'/'.$user.'/'.$innerpath; @@ -3086,7 +3090,7 @@ sub fileState { } my $docroot = $Apache::lonnet::perlvar{'lonDocRoot'}; my $subdirpart = $constructionSpaceDir; - $subdirpart =~ s/^\/home\/httpd\/html\/priv\/\Q$udom\E\/\Q$uname\E//; + $subdirpart =~ s{^\Q$docroot/priv/$udom/$uname\E}{}; my $resdir = $docroot . '/res/' . $udom . '/' . $uname . $subdirpart;