[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Thu, 12 Jan 2006 21:12:56 -0000
albertel Thu Jan 12 16:12:56 2006 EDT
Modified files:
/loncom/lonnet/perl lonnet.pm
Log:
- teaching file/hreflocation that cluttered names now feature the adm/wrapper / coursedocs bits
- BUG#4567
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.699 loncom/lonnet/perl/lonnet.pm:1.700
--- loncom/lonnet/perl/lonnet.pm:1.699 Wed Jan 11 16:00:47 2006
+++ loncom/lonnet/perl/lonnet.pm Thu Jan 12 16:12:55 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.699 2006/01/11 21:00:47 albertel Exp $
+# $Id: lonnet.pm,v 1.700 2006/01/12 21:12:55 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -6066,6 +6066,11 @@
my ($dir,$file) = @_;
my $location;
$file=~ s/^\s*(\S+)\s*$/$1/; ## strip off leading and trailing spaces
+
+ if ($file =~ m-^/adm/-) {
+ $file=~s-^/adm/wrapper/-/-;
+ $file=~s-^/adm/coursedocs/showdoc/-/-;
+ }
if ($file=~m:^/~:) { # is a contruction space reference
$location = $file;
$location =~ s:/~(.*?)/(.*):/home/$1/public_html/$2:;
@@ -6105,6 +6110,9 @@
my ($dir,$file)=@_;
unless (($file=~m-^http://-i) || ($file=~m-^/-)) {
$file=filelocation($dir,$file);
+ } elsif ($file=~m-^/adm/-) {
+ $file=~s-^/adm/wrapper/-/-;
+ $file=~s-^/adm/coursedocs/showdoc/-/-;
}
if ($file=~m-^\Q$perlvar{'lonDocRoot'}\E-) {
$file=~s-^\Q$perlvar{'lonDocRoot'}\E--;