version 1.8, 2006/08/21 15:21:31
|
version 1.10, 2007/10/02 01:09:53
|
Line 30 use strict;
|
Line 30 use strict;
|
use Apache::Constants qw(:common :http); |
use Apache::Constants qw(:common :http); |
use Apache::lonrep(); |
use Apache::lonrep(); |
use Apache::lonnet; |
use Apache::lonnet; |
use CGI::Cookie(); |
use LONCAPA(); |
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
if ($r->uri =~m|^/*uploaded/(\w+)/(\w+)/(.+)$|) { |
if ($r->uri =~m{^/*uploaded/($LONCAPA::domain_re)/($LONCAPA::name_re)/(.+)$}) { |
my $chome=&Apache::lonnet::homeserver($2,$1); |
my $chome=&Apache::lonnet::homeserver($2,$1); |
my @ids=&Apache::lonnet::current_machine_ids(); |
my @ids=&Apache::lonnet::current_machine_ids(); |
foreach my $id (@ids) { if ($id eq $chome) { return OK; } } |
foreach my $id (@ids) { if ($id eq $chome) { return OK; } } |
Line 58 sub handler {
|
Line 58 sub handler {
|
return OK; |
return OK; |
} |
} |
} |
} |
my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); |
my $handle = &Apache::lonnet::check_for_valid_session($r); |
my $lonid=$cookies{'lonID'}; |
if ($handle) { |
if ($lonid) { |
$r->log_reason('Copying failed in lonuploadrep for '.$handle); |
$r->log_reason('Copying failed in lonuploadrep for '.$lonid->value); |
|
return HTTP_NOT_FOUND; |
return HTTP_NOT_FOUND; |
} else { |
} else { |
$r->log_reason('Copying failed in lonuploadrep for unknown user'); |
$r->log_reason('Copying failed in lonuploadrep for unknown user'); |