[LON-CAPA-cvs] cvs: loncom /publisher loncfile.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 27 Nov 2002 17:05:50 -0000


albertel		Wed Nov 27 12:05:50 2002 EDT

  Modified files:              
    /loncom/publisher	loncfile.pm 
  Log:
  - Done link after delete is now correct
  - Fixes BUG#1010
  
  
Index: loncom/publisher/loncfile.pm
diff -u loncom/publisher/loncfile.pm:1.19 loncom/publisher/loncfile.pm:1.20
--- loncom/publisher/loncfile.pm:1.19	Mon Oct 28 18:23:41 2002
+++ loncom/publisher/loncfile.pm	Wed Nov 27 12:05:50 2002
@@ -10,7 +10,7 @@
 # 
 
 #
-# $Id: loncfile.pm,v 1.19 2002/10/28 23:23:41 albertel Exp $
+# $Id: loncfile.pm,v 1.20 2002/11/27 17:05:50 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1017,7 +1017,7 @@
 	# Once a resource is deleted, we just list the directory that
 	# previously held it.
 	#
-	$dest = $dir."/";		# Parent dir.
+	$dest = $dir."/.";		# Parent dir.
     } elsif ($ENV{'form.action'} eq 'copy') { 
 	if($ENV{'form.newfilename'}) {
 	    if(!&Copy2($r, $uname, $dir, $fn, $ENV{'form.newfilename'})) {
@@ -1046,11 +1046,12 @@
     # construction space path.
     #
     &Debug($r, "Final url is: $dest");
-    $dest =~ s/\/home\//\/priv\//;
-    $dest =~ s/\/public_html//;
+    $dest =~ s|/home/|/priv/|;
+    $dest =~ s|/public_html||;
     
     my $base = &File::Basename::basename($dest);
     my $dpath= &File::Basename::dirname($dest);
+    if ($base eq '.') { $base=''; }
     $dest = &HTML::Entities::encode($dpath.'/'.$base);