version 1.484.2.50, 2014/02/24 17:10:37
|
version 1.484.2.51, 2014/03/18 02:37:52
|
Line 46 use Apache::lonsimplepage();
|
Line 46 use Apache::lonsimplepage();
|
use HTML::Entities; |
use HTML::Entities; |
use HTML::TokeParser; |
use HTML::TokeParser; |
use GDBM_File; |
use GDBM_File; |
|
use File::MMagic; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Cwd; |
use Cwd; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
Line 3174 sub process_file_upload {
|
Line 3175 sub process_file_upload {
|
my $quotatype = 'unofficial'; |
my $quotatype = 'unofficial'; |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
$quotatype = 'community'; |
$quotatype = 'community'; |
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.instcode'}) { |
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.coursecode'}) { |
$quotatype = 'official'; |
$quotatype = 'official'; |
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.textbook'}) { |
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.textbook'}) { |
$quotatype = 'textbook'; |
$quotatype = 'textbook'; |
Line 3182 sub process_file_upload {
|
Line 3183 sub process_file_upload {
|
if (&Apache::loncommon::get_user_quota($coursenum,$coursedom,'course',$quotatype)) { |
if (&Apache::loncommon::get_user_quota($coursenum,$coursedom,'course',$quotatype)) { |
$filesize = int($filesize/1000); #expressed in kb |
$filesize = int($filesize/1000); #expressed in kb |
$$upload_output = &Apache::loncommon::excess_filesize_warning($coursenum,$coursedom,'course', |
$$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); |
return if ($$upload_output); |
} |
} |
my ($parseaction,$showupload,$nextphase,$mimetype); |
my ($parseaction,$showupload,$nextphase,$mimetype); |
Line 3280 sub process_file_upload {
|
Line 3282 sub process_file_upload {
|
$$upload_output .= &mt('No embedded items identified').'<br />'; |
$$upload_output .= &mt('No embedded items identified').'<br />'; |
} |
} |
$$upload_output = '<div id="uploadfileresult">'.$$upload_output.'</div>'; |
$$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'; |
$nextphase = 'decompress_uploaded'; |
my $position = scalar(@LONCAPA::map::order)-1; |
my $position = scalar(@LONCAPA::map::order)-1; |
my $noextract = &return_to_editor(); |
my $noextract = &return_to_editor(); |