version 1.63, 2013/07/02 19:04:49
|
version 1.64, 2013/07/03 05:03:19
|
Line 201 sub phaseone {
|
Line 201 sub phaseone {
|
return; |
return; |
} |
} |
$filesize = int($filesize/1000); #expressed in kb |
$filesize = int($filesize/1000); #expressed in kb |
my $disk_quota = &Apache::loncommon::get_user_quota($uname,$udom,'author'); #expressed in Mb |
my $authorspace = $Apache::lonnet::perlvar{'lonDocRoot'}."/priv/$udom/$uname"; |
$disk_quota = int($disk_quota * 1000); |
my $output = &Apache::loncommon::excess_filesize_authorspace($uname,$udom,$authorspace, |
my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; |
$env{'form.upfile.filename'},$filesize,'upload'); |
my $current_disk_usage = &Apache::lonnet::diskusage($udom,$uname,"$londocroot/priv/$udom/$uname"); |
if ($output) { |
if (($current_disk_usage + $filesize) > $disk_quota){ |
$r->print($output.&earlyout($fn,$uname,$udom)); |
$r->print('<span class="LC_warning">'. |
|
&mt('Unable to upload [_1]. (size = [_2] kilobytes). Disk quota will be exceeded.','<span class="LC_filename">'.$env{'form.upfile.filename'}.'</span>',$filesize).'</span>'. |
|
'<br />'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.',$disk_quota,$current_disk_usage). |
|
'</p>'. |
|
&earlyout($fn,$uname,$udom)); |
|
return; |
return; |
} |
} |
|
|
# Split part that I can change from the part that I cannot change |
# Split part that I can change from the part that I cannot change |
my ($fn1,$fn2)=($fn=~/^(\/priv\/[^\/]+\/[^\/]+\/)(.*)$/); |
my ($fn1,$fn2)=($fn=~/^(\/priv\/[^\/]+\/[^\/]+\/)(.*)$/); |
# Display additional options for upload |
# Display additional options for upload |