version 1.67, 2015/09/11 20:12:30
|
version 1.68, 2017/11/12 23:01:00
|
Line 130 use Apache::lonnet;
|
Line 130 use Apache::lonnet;
|
use HTML::Entities(); |
use HTML::Entities(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonnet; |
use Apache::lonnet; |
use LONCAPA(); |
use LONCAPA qw(:DEFAULT :match); |
|
|
my $DEBUG=0; |
my $DEBUG=0; |
|
|
Line 150 sub upfile_store {
|
Line 150 sub upfile_store {
|
|
|
chomp($env{'form.upfile'}); |
chomp($env{'form.upfile'}); |
|
|
my $datatoken=$env{'user.name'}.'_'.$env{'user.domain'}. |
my $datatoken; |
'_upload_'.$fname.'_'.time.'_'.$$; |
if (($env{'user.name'} =~ /^$match_username$/) && ($env{'user.domain'} =~ /^$match_domain$/)) { |
|
$datatoken=$env{'user.name'}.'_'.$env{'user.domain'}. |
|
'_upload_'.$fname.'_'.time.'_'.$$; |
|
} |
|
return if ($datatoken eq ''); |
{ |
{ |
my $fh=Apache::File->new('>'.$r->dir_config('lonDaemons'). |
my $fh=Apache::File->new('>'.$r->dir_config('lonDaemons'). |
'/tmp/'.$datatoken.'.tmp'); |
'/tmp/'.$datatoken.'.tmp'); |
Line 279 sub phasetwo {
|
Line 283 sub phasetwo {
|
$base = &HTML::Entities::encode($base,'<>&"'); |
$base = &HTML::Entities::encode($base,'<>&"'); |
my $url = $path."/".$base; |
my $url = $path."/".$base; |
&Debug($r, "URL is now ".$url); |
&Debug($r, "URL is now ".$url); |
my $datatoken=$env{'form.datatoken'}; |
my $datatoken; |
|
if ($env{'form.datatoken'} =~ /^$match_username\_$match_domain\_upload_\w*_\d+_\d+$/) { |
|
$datatoken = $env{'form.datatoken'}; |
|
} |
if (($fn) && ($datatoken)) { |
if (($fn) && ($datatoken)) { |
if ($env{'form.cancel'}) { |
if ($env{'form.cancel'}) { |
my $source=$r->dir_config('lonDaemons').'/tmp/'.$datatoken.'.tmp'; |
my $source=$r->dir_config('lonDaemons').'/tmp/'.$datatoken.'.tmp'; |