--- loncom/interface/lonfeedback.pm 2021/01/04 03:43:30 1.370.2.5
+++ loncom/interface/lonfeedback.pm 2017/11/08 00:36:56 1.375
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.370.2.5 2021/01/04 03:43:30 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.375 2017/11/08 00:36:56 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -44,7 +44,7 @@ use HTML::LCParser();
#use HTML::Tidy::libXML;
use Apache::lonspeller();
use Apache::longroup;
-use Archive::Zip qw( :ERROR_CODES );
+use Cwd;
use LONCAPA qw(:DEFAULT :match);
sub discussion_open {
@@ -698,19 +698,18 @@ END
if (($env{'user.name'} =~ /^$match_username$/)
&& ($env{'user.domain'} =~ /^$match_domain$/)) {
- my $now = time();
+ my $now = time();
my $imszipfile = '/prtspool/'.
join('_',$env{'user.name'},$env{'user.domain'},$now).
'_'.rand(1000000000).'.zip';
- my $zip = Archive::Zip->new();
- $zip->addTree($tempexport);
+ my $cwd = &getcwd();
my $imszip = '/home/httpd/'.$imszipfile;
- if ($zip->writeToFileNamed($imszip) == AZ_OK) {
- $discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive[_2]',
+ chdir $tempexport;
+ open(OUTPUT, "zip -r $imszip * 2> /dev/null |");
+ close(OUTPUT);
+ chdir $cwd;
+ $discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive[_2]',
'','').'
';
- } else {
- $discussion .= &mt('Failed to create zip file').'
';
- }
if ($copyresult) {
$discussion .= ''.
&mt('The following errors occurred during export:').
@@ -960,9 +959,14 @@ sub postingform_display {
}
}
}
+ my $postanon;
+ if (&Apache::lonnet::allowed('pac',$env{'request.course.id'}.
+ ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
+ $postanon = '';
+ }
$postingform .= (<