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

www www at source.lon-capa.org
Sat Oct 22 17:25:37 EDT 2011


www		Sat Oct 22 21:25:37 2011 EDT

  Modified files:              
    /loncom/publisher	loncfile.pm lonpublisher.pm 
  Log:
  Read the metafiles
  
  
Index: loncom/publisher/loncfile.pm
diff -u loncom/publisher/loncfile.pm:1.106 loncom/publisher/loncfile.pm:1.107
--- loncom/publisher/loncfile.pm:1.106	Tue Mar  1 01:36:55 2011
+++ loncom/publisher/loncfile.pm	Sat Oct 22 21:25:37 2011
@@ -9,7 +9,7 @@
 #  and displays a page showing the results of the action.
 #
 #
-# $Id: loncfile.pm,v 1.106 2011/03/01 01:36:55 raeburn Exp $
+# $Id: loncfile.pm,v 1.107 2011/10/22 21:25:37 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -175,7 +175,8 @@
 
 sub display {
     my $fn=shift;
-    $fn=~s-^/home/($match_username)/public_html-/priv/$1-;
+    $fn=~s/^\/home\/httpd\/html//;
+    $fn=~s/\/\.\//\//g;
     return '<span class="LC_filename">'.$fn.'</span>';
 }
 
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.268 loncom/publisher/lonpublisher.pm:1.269
--- loncom/publisher/lonpublisher.pm:1.268	Sat Oct 22 15:16:20 2011
+++ loncom/publisher/lonpublisher.pm	Sat Oct 22 21:25:37 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.268 2011/10/22 15:16:20 www Exp $
+# $Id: lonpublisher.pm,v 1.269 2011/10/22 21:25:37 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1080,16 +1080,16 @@
 # ------------------------------------------------ Check out directory hierachy
 
         my $thisdisfn=$source;
-        $thisdisfn=~s/^\/home\/\Q$cuname\E\///;
 
-        my @urlparts=split(/\//,$thisdisfn);
+        $thisdisfn=~s/^\Q$docroot\E\/priv\/\Q$cudom\E\/\Q$cuname\E\///;
+        my @urlparts=('.',split(/\//,$thisdisfn));
         $#urlparts--;
 
-        my $currentpath='/home/'.$cuname.'/';
+        my $currentpath=$docroot.'/priv/'.$cudom.'/'.$cuname.'/';
 
 	my $prefix='../'x($#urlparts);
-        foreach (@urlparts) {
-	    $currentpath.=$_.'/';
+        foreach my $subdir (@urlparts) {
+	    $currentpath.=$subdir.'/';
             $scrout.=&metaread($logfile,$currentpath.'default.meta',$prefix);
 	    $prefix=~s|^\.\./||;
         }
@@ -2246,7 +2246,7 @@
 	    }
 	    unless ($errorcount) {
 		my ($outstring,$error)=
-		    &publish($fn,$thistarget,$thisembstyle);
+		    &publish($docroot.$fn,$thistarget,$thisembstyle);
 		$r->print($outstring);
 	    } else {
 		$r->print('<h3 class="LC_error">'.




More information about the LON-CAPA-cvs mailing list