--- loncom/lonnet/perl/lonnet.pm 2006/01/10 21:41:39 1.694 +++ loncom/lonnet/perl/lonnet.pm 2006/01/11 20:27:43 1.698 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.694 2006/01/10 21:41:39 albertel Exp $ +# $Id: lonnet.pm,v 1.698 2006/01/11 20:27:43 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4965,6 +4965,11 @@ sub EXT { if ($space eq 'time') { return time; } + } elsif ($realm eq 'server') { +# ----------------------------------------------------------------- system.time + if ($space eq 'name') { + return $ENV{'SERVER_NAME'}; + } } return ''; } @@ -5037,8 +5042,7 @@ sub metadata { # if it is a non metadata possible uri return quickly if (($uri eq '') || (($uri =~ m|^/*adm/|) && - ($uri !~ m|^adm/includes|) && ($uri !~ m|/bulletinboard$|) - && ($uri !~ m|^adm/coursedocs/|) && ($uri !~ m|^adm/wrapper/|)) || + ($uri !~ m|^adm/includes|) && ($uri !~ m|/bulletinboard$|)) || ($uri =~ m|/$|) || ($uri =~ m|/.meta$|) || ($uri =~ /^~/) || ($uri =~ m|home/[^/]+/public_html/|)) { return undef; @@ -6144,10 +6148,10 @@ sub declutter { if ($thisfn=~m|^/enc/|) { $thisfn=&Apache::lonenc::unencrypted($thisfn); } $thisfn=~s/^\Q$perlvar{'lonDocRoot'}\E//; $thisfn=~s/^\///; + $thisfn=~s|^adm/wrapper/||; + $thisfn=~s|^adm/coursedocs/showdoc/||; $thisfn=~s/^res\///; $thisfn=~s/\?.+$//; - $thisfn=~s|adm/wrapper/||; - $thisfn=~s|adm/coursedocs/showdoc/||; return $thisfn; } @@ -6159,19 +6163,29 @@ sub clutter { $thisfn='/res'.$thisfn; } if ($thisfn !~m|/adm|) { - my ($ext) = ($thisfn =~ /\.(\w+)$/); - my $embstyle=&Apache::loncommon::fileembstyle($ext); - if (($embstyle eq 'img') - || ($embstyle eq 'emb') - || ($embstyle eq 'wrp')) { + if ($thisfn =~ m|/ext/|) { $thisfn='/adm/wrapper'.$thisfn; - } elsif ($embstyle eq 'ssi') { - #do nothing with these - } elsif ($thisfn!~/\.(sequence|page)$/) { - $thisfn='/adm/coursedocs/showdoc'.$thisfn; + } else { + my ($ext) = ($thisfn =~ /\.(\w+)$/); + my $embstyle=&Apache::loncommon::fileembstyle($ext); + if ($embstyle eq 'ssi' + || ($embstyle eq 'hdn') + || ($embstyle eq 'rat') + || ($embstyle eq 'prv') + || ($embstyle eq 'ign')) { + #do nothing with these + } elsif (($embstyle eq 'img') + || ($embstyle eq 'emb') + || ($embstyle eq 'wrp')) { + $thisfn='/adm/wrapper'.$thisfn; + } elsif ($embstyle eq 'unk' + && $thisfn!~/\.(sequence|page)$/) { + $thisfn='/adm/coursedocs/showdoc'.$thisfn; + } else { + &logthis("Got a blank emb style"); + } } } - return $thisfn; }