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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Mon, 21 Apr 2008 15:58:17 -0000


raeburn		Mon Apr 21 11:58:17 2008 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  &dirlist() - call to ls3 should include $dirRoot not $alternateRoot.
  &stat_file() - $getpropath only set to 1 if filepath begins with "userfiles".
  &filelocation() - files with paths beginning with lonTabDir have $location = $file.  
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.955 loncom/lonnet/perl/lonnet.pm:1.956
--- loncom/lonnet/perl/lonnet.pm:1.955	Wed Apr 16 18:59:36 2008
+++ loncom/lonnet/perl/lonnet.pm	Mon Apr 21 11:58:12 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.955 2008/04/16 22:59:36 raeburn Exp $
+# $Id: lonnet.pm,v 1.956 2008/04/21 15:58:12 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -6264,7 +6264,7 @@
     if($udom) {
         if($uname) {
             $listing = &reply('ls3:'.&escape('/'.$uri).':'.$getpropath.':'
-                              .$getuserdir.':'.&escape($alternateRoot)
+                              .$getuserdir.':'.&escape($dirRoot)
                               .':'.&escape($uname).':'.&escape($udom),
                               &homeserver($uname,$udom));
             if ($listing eq 'unknown_cmd') {
@@ -6371,8 +6371,10 @@
 	# unable to handle the uri
 	return ();
     }
-
-    my $getpropath = 1;
+    my $getpropath;
+    if ($file =~ /^userfiles\//) {
+        $getpropath = 1;
+    }
     my ($result) = &dirlist($file,$udom,$uname,$getpropath);
     my @stats = split('&', $result);
     
@@ -8118,6 +8120,8 @@
     } elsif ($file=~m{^/home/$match_username/public_html/}) {
 	# is a correct contruction space reference
         $location = $file;
+    } elsif ($file =~ m-^\Q$Apache::lonnet::perlvar{'lonTabDir'}\E/-) {
+        $location = $file;
     } elsif ($file=~/^\/*(uploaded|editupload)/) { # is an uploaded file
         my ($udom,$uname,$filename)=
   	    ($file=~m -^/+(?:uploaded|editupload)/+($match_domain)/+($match_name)/+(.*)$-);