[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface londocs.pm
raeburn
raeburn at source.lon-capa.org
Mon Mar 17 22:37:52 EDT 2014
raeburn Tue Mar 18 02:37:52 2014 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface londocs.pm
Log:
- For 2.11
- Backport 1.578, 1.579, 1.580.
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.484.2.50 loncom/interface/londocs.pm:1.484.2.51
--- loncom/interface/londocs.pm:1.484.2.50 Mon Feb 24 17:10:37 2014
+++ loncom/interface/londocs.pm Tue Mar 18 02:37:52 2014
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.484.2.50 2014/02/24 17:10:37 raeburn Exp $
+# $Id: londocs.pm,v 1.484.2.51 2014/03/18 02:37:52 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -46,6 +46,7 @@
use HTML::Entities;
use HTML::TokeParser;
use GDBM_File;
+use File::MMagic;
use Apache::lonlocal;
use Cwd;
use LONCAPA qw(:DEFAULT :match);
@@ -3174,7 +3175,7 @@
my $quotatype = 'unofficial';
if ($crstype eq 'Community') {
$quotatype = 'community';
- } elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.instcode'}) {
+ } elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.coursecode'}) {
$quotatype = 'official';
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.textbook'}) {
$quotatype = 'textbook';
@@ -3182,7 +3183,8 @@
if (&Apache::loncommon::get_user_quota($coursenum,$coursedom,'course',$quotatype)) {
$filesize = int($filesize/1000); #expressed in kb
$$upload_output = &Apache::loncommon::excess_filesize_warning($coursenum,$coursedom,'course',
- $env{'form.uploaddoc.filename'},$filesize,'upload');
+ $env{'form.uploaddoc.filename'},$filesize,
+ 'upload',$quotatype);
return if ($$upload_output);
}
my ($parseaction,$showupload,$nextphase,$mimetype);
@@ -3280,7 +3282,8 @@
$$upload_output .= &mt('No embedded items identified').'<br />';
}
$$upload_output = '<div id="uploadfileresult">'.$$upload_output.'</div>';
- } elsif (&Apache::loncommon::is_archive_file($mimetype)) {
+ } elsif ((&Apache::loncommon::is_archive_file($mimetype)) &&
+ ($env{'form.uploaddoc.filename'} =~ /\.(zip|tar|bz2|gz|tar.gz|tar.bz2|tgz)$/i)) {
$nextphase = 'decompress_uploaded';
my $position = scalar(@LONCAPA::map::order)-1;
my $noextract = &return_to_editor();
More information about the LON-CAPA-cvs
mailing list