--- loncom/lonnet/perl/lonnet.pm 2000/10/31 22:32:32 1.57 +++ loncom/lonnet/perl/lonnet.pm 2000/11/07 17:20:10 1.59 @@ -42,7 +42,7 @@ # directcondval(index) : reading condition value of single condition from # state string # condval(index) : value of condition index based on state -# varval(name) : value of a variable +# EXT(name) : value of a variable # refreshstate() : refresh the state information string # symblist(map,hash) : Updates symbolic storage links # symbread([filename]) : returns the data handle (filename optional) @@ -68,7 +68,7 @@ # 10/04 Gerd Kortemeyer # 10/04 Guy Albertelli # 10/06,10/09,10/10,10/11,10/14,10/20,10/23,10/25,10/26,10/27,10/28,10/29, -# 10/30,10/31 Gerd Kortemeyer +# 10/30,10/31,11/2 Gerd Kortemeyer package Apache::lonnet; @@ -1192,7 +1192,7 @@ sub condval { # --------------------------------------------------------- Value of a Variable -sub varval { +sub EXT { my $varname=shift; my ($realm,$space,$qualifier,@therest)=split(/\./,$varname); my $rest; @@ -1418,12 +1418,17 @@ sub filelocation { my ($dir,$file) = @_; my $location; $file=~ s/^\s*(\S+)\s*$/$1/; ## strip off leading and trailing spaces - $file=~s/^$perlvar{'lonDocRoot'}//; - $file=~s:^/*res::; - if ( !( $file =~ m:^/:) ) { - $location = $dir. '/'.$file; + if ($file=~m:^/~:) { # is a contruction space reference + $location = $file; + $location =~ s:/~(.*?)/(.*):/home/$1/public_html/$2:; } else { - $location = '/home/httpd/html/res'.$file; + $file=~s/^$perlvar{'lonDocRoot'}//; + $file=~s:^/*res::; + if ( !( $file =~ m:^/:) ) { + $location = $dir. '/'.$file; + } else { + $location = '/home/httpd/html/res'.$file; + } } $location=~s://+:/:g; # remove duplicate / while ($location=~m:/\.\./:) {$location=~ s:/[^/]+/\.\./:/:g;} #remove dir/..