--- loncom/imspackages/imsimport.pm 2010/09/26 02:10:49 1.33 +++ loncom/imspackages/imsimport.pm 2011/10/24 22:02:38 1.35 @@ -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.35 2011/10/24 22:02:38 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -604,8 +604,8 @@ sub display_three { } 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('

'.$lt{'plsv'}.' '.$lt{'tseq'}.'

'.$lt{'tfin'}.'

'.$lt{'disp'}.''); - if ($destdir =~ m-^/home/$uname/public_html/-) { + $r->print('

'.$lt{'plsv'}.' '.$lt{'tseq'}.'

'.$lt{'tfin'}.'

'.$lt{'disp'}.''); + if ($destdir =~ m-^/home/httpd/html/priv/$udom/$uname/-) { system (" rm -r -f $destdir/temp"); } } elsif ($manifest_result eq 'nomanifest') { @@ -684,7 +684,7 @@ sub handler { # 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 @@ sub handler { $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 .= '/'; } @@ -754,7 +754,7 @@ sub handler { } elsif ( ($env{'form.phase'} eq 'three') || ($env{'form.phase'} eq 'four') ) { my $docroot = $env{'form.newdir'}; my $newdir = ''; - if ($docroot =~ m|public_html/(.+)$|) { + if ($docroot =~ m|/(.+)$|) { $newdir = $1; } if ($env{'form.phase'} eq 'three') {