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

www www at source.lon-capa.org
Sat Oct 22 18:05:23 EDT 2011


www		Sat Oct 22 22:05:23 2011 EDT

  Modified files:              
    /loncom/publisher	lonpublisher.pm 
  Log:
  Bug #1320 ...
  
  
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.269 loncom/publisher/lonpublisher.pm:1.270
--- loncom/publisher/lonpublisher.pm:1.269	Sat Oct 22 21:25:37 2011
+++ loncom/publisher/lonpublisher.pm	Sat Oct 22 22:05:23 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.269 2011/10/22 21:25:37 www Exp $
+# $Id: lonpublisher.pm,v 1.270 2011/10/22 22:05:23 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1223,14 +1223,12 @@
     my $intr_scrout.='<br />'
                     .'<form name="pubform" action="/adm/publish" method="post">';
     unless ($env{'form.makeobsolete'}) {
-       my $thissrc=$source;
-       $thissrc=~s{^/home/($match_username)/public_html}{/priv/$1};
        $intr_scrout.='<p class="LC_warning">'
                     .&mt('Searching for your resource will be based on the following metadata. Please provide as much data as possible.')
                     .'</p>'
                     .'<p><input type="submit" value="'
                     .&mt('Finalize Publication')
-                    .'" /> <a href="'.$thissrc.'">'.&mt('Cancel').'</a></p>';
+                    .'" /> <a href="'.&Apache::loncfile::display($source).'">'.&mt('Cancel').'</a></p>';
     }
     $intr_scrout.=&Apache::lonhtmlcommon::start_pick_box();
     $intr_scrout.=
@@ -1767,9 +1765,8 @@
 
 # ------------------------------------------------ Provide link to new resource
     unless ($batch) {
-        my $thissrc=$source;
-        $thissrc=~s{^/home/($match_username)/public_html}{/priv/$1};
         
+        my $thissrc=&Apache::loncfile::display($source);
         my $thissrcdir=$thissrc;
         $thissrcdir=~s/\/[^\/]+$/\//;
         
@@ -1839,8 +1836,6 @@
     my %oldenv=%env;
     $srcfile=~s/\/+/\//g;
     $targetfile=~s/\/+/\//g;
-    my $thisdisfn=$srcfile;
-    $thisdisfn=~s/\/home\/korte\/public_html\///;
     $srcfile=~s/\/+/\//g;
 
     my $docroot=$r->dir_config('lonDocRoot');
@@ -1858,7 +1853,7 @@
      
     $r->print('<h2>'
              .&mt('Publishing [_1]'
-                 ,'<span class="LC_filename">'.$thisdisfn.'</span>')
+                 ,'<span class="LC_filename">'.&Apache::loncfile::display($srcfile).'</span>')
              .'</h2>'
     );
 
@@ -1973,12 +1968,11 @@
 
 sub defaultmetapublish {
     my ($r,$fn,$cuname,$cudom)=@_;
-    $fn=~s/^\/\~$cuname\//\/home\/$cuname\/public_html\//;
     unless (-e $fn) {
        return HTTP_NOT_FOUND;
     }
     my $target=$fn;
-    $target=~s/^\/home\/$cuname\/public_html\//$Apache::lonnet::perlvar{'lonDocRoot'}\/res\/$cudom\/$cuname\//;
+    $target=~s/^\Q$Apache::lonnet::perlvar{'lonDocRoot'}\E\/priv\//\Q$Apache::lonnet::perlvar{'lonDocRoot'}\E\/res\//;
 
 
     &Apache::loncommon::content_type($r,'text/html');
@@ -2021,9 +2015,7 @@
 	$r->print($reply.'</p><br />');$r->rflush;
     }
 # ------------------------------------------------------------------- Link back
-    my $link=$fn;
-    $link=~s/^\/home\/$cuname\/public_html\//\/priv\/$cuname\//;
-    $r->print("<a href='$link'>".&mt('Back to Metadata').'</a>');
+    $r->print("<a href='".&Apache::lonnet::display($fn)."'>".&mt('Back to Metadata').'</a>');
     $r->print(&Apache::loncommon::end_page());
     return OK;
 }




More information about the LON-CAPA-cvs mailing list