[LON-CAPA-cvs] cvs: loncom /imspackages imsimport.pm

www www at source.lon-capa.org
Mon Oct 24 17:58:04 EDT 2011


www		Mon Oct 24 21:58:04 2011 EDT

  Modified files:              
    /loncom/imspackages	imsimport.pm 
  Log:
  Bug #1320
  
  
Index: loncom/imspackages/imsimport.pm
diff -u loncom/imspackages/imsimport.pm:1.33 loncom/imspackages/imsimport.pm:1.34
--- loncom/imspackages/imsimport.pm:1.33	Sun Sep 26 02:10:49 2010
+++ loncom/imspackages/imsimport.pm	Mon Oct 24 21:58:04 2011
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 # 
-# $Id: imsimport.pm,v 1.33 2010/09/26 02:10:49 raeburn Exp $
+# $Id: imsimport.pm,v 1.34 2011/10/24 21:58:04 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -604,8 +604,8 @@
         } else {
             $r->print($lt{'yims'}.' '.&mt('A total of [quant,_1,sequence], [quant,_2,composite page], [quant,_3,bulletin board], [quant,_4,quiz,quizzes], [quant,_5,survey], and [quant,_6,problem] have been created, and [quant,_7,file] copied.',$total{seq},$total{page},$total{board},$total{quiz},$total{surv},$total{prob},$total{file})."\n");
         }
-        $r->print('<br /><br />'.$lt{'plsv'}.' '.$lt{'tseq'}.'<br /><br />'.$lt{'tfin'}.'<br /><br /><a href="/priv/'.$uname.'/'.$newdir.'">'.$lt{'disp'}.'</a>');
-        if ($destdir =~ m-^/home/$uname/public_html/-) {
+        $r->print('<br /><br />'.$lt{'plsv'}.' '.$lt{'tseq'}.'<br /><br />'.$lt{'tfin'}.'<br /><br /><a href="/priv/'.$udom.'/'.$uname.'/'.$newdir.'">'.$lt{'disp'}.'</a>');
+        if ($destdir =~ m-^/home/httpd/html/priv/$udom/$uname/-) {
             system (" rm -r -f $destdir/temp");
         }
     } elsif ($manifest_result eq 'nomanifest') {
@@ -684,7 +684,7 @@
 # re-attach user
 #
     if ($env{'form.uploaduname'}) {
-        $env{'form.filename'}='/priv/'.$env{'form.uploaduname'}.'/'.
+        $env{'form.filename'}='/priv/'.$dom.'/'.$env{'form.uploaduname'}.'/'.
             $env{'form.filename'};
     }
     ($uname,$udom)=
@@ -703,16 +703,16 @@
         $fn=$env{'form.filename'};
         $fn=~s/^https?\:\/\/[^\/]+\///;
         $fn=~s/^\///;
-        $fn=~s/(\~|priv\/)($LONCAPA::username_re)//;
+        $fn=~s/(priv\/)($LONCAPA::domain_re)\/($LONCAPA::username_re)//;
         $fn=~s/\/+/\//g;
     } else {
         $r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.
                        ' unspecified filename for upload', $r->filename);
         return HTTP_NOT_FOUND;
     }
-    my $zipupload = '/home/'.$uname.'/public_html'.$fn;
+    my $zipupload = '/home/httpd/html/priv/'.$udom.'/'.$uname.$fn;
     my $pathname = &File::Basename::dirname($fn);
-    my $fullpath = '/priv/'.$uname.$pathname;
+    my $fullpath = '/priv/'.$udom.'/'.$uname.$pathname;
     unless ($pathname eq '/') {
         $fullpath .= '/';
     }




More information about the LON-CAPA-cvs mailing list