[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 11 Jan 2006 07:32:24 -0000


albertel		Wed Jan 11 02:32:24 2006 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - external resources should be /adm/wrapper/ed
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.694 loncom/lonnet/perl/lonnet.pm:1.695
--- loncom/lonnet/perl/lonnet.pm:1.694	Tue Jan 10 16:41:39 2006
+++ loncom/lonnet/perl/lonnet.pm	Wed Jan 11 02:32:21 2006
@@ -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.695 2006/01/11 07:32:21 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -6146,8 +6146,8 @@
     $thisfn=~s/^\///;
     $thisfn=~s/^res\///;
     $thisfn=~s/\?.+$//;
-    $thisfn=~s|adm/wrapper/||;
-    $thisfn=~s|adm/coursedocs/showdoc/||;
+    $thisfn=~s|^adm/wrapper/||;
+    $thisfn=~s|^adm/coursedocs/showdoc/||;
     return $thisfn;
 }
 
@@ -6159,19 +6159,22 @@
        $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 'img') 
+		|| ($embstyle eq 'emb')
+		|| ($embstyle eq 'wrp')) {
+		$thisfn='/adm/wrapper'.$thisfn;
+	    } elsif ($embstyle eq 'ssi') {
+		#do nothing with these
+	    } elsif ($thisfn!~/\.(sequence|page)$/) {
+		$thisfn='/adm/coursedocs/showdoc'.$thisfn;
+	    }
 	}
     }
-
     return $thisfn;
 }