version 1.373, 2017/05/30 00:01:32
|
version 1.374, 2017/11/03 21:36:27
|
Line 45 use HTML::LCParser();
|
Line 45 use HTML::LCParser();
|
use Apache::lonspeller(); |
use Apache::lonspeller(); |
use Apache::longroup; |
use Apache::longroup; |
use Cwd; |
use Cwd; |
use LONCAPA; |
use LONCAPA qw(:DEFAULT :match); |
|
|
sub discussion_open { |
sub discussion_open { |
my ($status,$symb)=@_; |
my ($status,$symb)=@_; |
Line 696 END
|
Line 696 END
|
|
|
#Create zip file in prtspool |
#Create zip file in prtspool |
|
|
my $imszipfile = '/prtspool/'. |
if (($env{'user.name'} =~ /^$match_username$/) |
$env{'user.name'}.'_'.$env{'user.domain'}.'_'. |
&& ($env{'user.domain'} =~ /^$match_domain$/)) { |
time.'_'.rand(1000000000).'.zip'; |
my $now = time(); |
my $cwd = &getcwd(); |
my $imszipfile = '/prtspool/'. |
my $imszip = '/home/httpd/'.$imszipfile; |
join('_',$env{'user.name'},$env{'user.domain'},$now). |
chdir $tempexport; |
'_'.rand(1000000000).'.zip'; |
open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); |
my $cwd = &getcwd(); |
close(OUTPUT); |
my $imszip = '/home/httpd/'.$imszipfile; |
chdir $cwd; |
chdir $tempexport; |
$discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive[_2]', |
open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); |
|
close(OUTPUT); |
|
chdir $cwd; |
|
$discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive[_2]', |
'<a href="'.$imszipfile.'">','</a>').'<br />'; |
'<a href="'.$imszipfile.'">','</a>').'<br />'; |
if ($copyresult) { |
if ($copyresult) { |
$discussion .= '<span class="LC_error">'. |
$discussion .= '<span class="LC_error">'. |
&mt('The following errors occurred during export:'). |
&mt('The following errors occurred during export:'). |
'</span><br />'.$copyresult; |
'</span><br />'.$copyresult; |
|
} |
|
} else { |
|
$discussion .= '<p class="LC_error">'. |
|
&mt('Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating the zip file.').'</p>'; |
} |
} |
} |
} |
} else { |
} else { |