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

raeburn raeburn at source.lon-capa.org
Sun Oct 30 21:30:38 EDT 2011


raeburn		Mon Oct 31 01:30:38 2011 EDT

  Modified files:              
    /loncom/publisher	lonretrieve.pm 
  Log:
  - Bug 1320.
  
  
Index: loncom/publisher/lonretrieve.pm
diff -u loncom/publisher/lonretrieve.pm:1.44 loncom/publisher/lonretrieve.pm:1.45
--- loncom/publisher/lonretrieve.pm:1.44	Mon Oct 24 22:10:21 2011
+++ loncom/publisher/lonretrieve.pm	Mon Oct 31 01:30:38 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to retrieve an old version of a file
 #
-# $Id: lonretrieve.pm,v 1.44 2011/10/24 22:10:21 www Exp $
+# $Id: lonretrieve.pm,v 1.45 2011/10/31 01:30:38 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -121,7 +121,7 @@
     
     if (-e $resfn) {  
 	$r->print('<form action="/adm/retrieve" method="post">'.
-		  '<input type="hidden" name="filename" value="/~'.$uname.$fn.'" />'.
+		  '<input type="hidden" name="filename" value="/priv/'.$udom.'/'.$uname.$fn.'" />'.
 		  '<input type="hidden" name="phase" value="two" />'.
 		  &Apache::loncommon::start_data_table().
 		  &Apache::loncommon::start_data_table_header_row().
@@ -162,8 +162,8 @@
 		if ($is_meta
 		    || &Apache::loncommon::fileembstyle($suffix) eq 'ssi') {
 		    $r->print(
-			      '<td><a target="cat" href="/adm/diff?filename=/~'.
-			      $uname.$fn.
+			      '<td><a target="cat" href="/adm/diff?filename=/priv/'.
+			      $udom,'/'.$uname.$fn.
 			      '&versiontwo=priv&versionone='.$version.
 			      '">'.&mt('Diffs with Version').' '.$version.
 			      '</a></td>');
@@ -185,8 +185,8 @@
 	if ($is_meta 
 	    || &Apache::loncommon::fileembstyle($suffix) eq 'ssi') {
 	    $r->print(
-		      '<td><a target="cat" href="/adm/diff?filename=/~'.
-		      $uname.$fn.
+		      '<td><a target="cat" href="/adm/diff?filename=/priv/'.
+		      $udom.'/'.$uname.$fn.
 		      '&versiontwo=priv'.
 		      '">'.&mt('Diffs with current Version').'</a></td>');
 	}
@@ -319,9 +319,8 @@
   my $uname;
   my $udom;
 
-  ($uname,$udom)=
-    &Apache::loncacc::constructaccess($fn,$r->dir_config('lonDefDomain'));
-  unless (($uname) && ($udom)) {
+  ($uname,$udom) = &Apache::loncacc::constructaccess($fn);
+  unless (($uname ne '') && ($udom ne '')) {
      $r->log_reason($uname.' at '.$udom.
          ' trying to publish file '.$env{'form.filename'}.
          ' ('.$fn.') - not authorized', 
@@ -329,7 +328,7 @@
      return HTTP_NOT_ACCEPTABLE;
   }
 
-  $fn=~s{/~($LONCAPA::username_re)}{};
+  $fn=~s{/priv/$LONCAPA::domain_re/$LONCAPA::username_re}{};
 
   &Apache::loncommon::content_type($r,'text/html');
   $r->send_http_header;




More information about the LON-CAPA-cvs mailing list