version 1.12, 2004/04/26 00:07:29
|
version 1.13, 2004/05/03 19:52:19
|
Line 59 sub handler {
|
Line 59 sub handler {
|
if ($reqhost eq 'localhost.localdomain') { |
if ($reqhost eq 'localhost.localdomain') { |
return OK; |
return OK; |
} |
} |
my $readline; |
my $return; |
my $lontabdir=$r->dir_config('lonTabDir'); |
my @ids=(); |
{ |
my $id; |
my $fh; |
foreach $id (keys %Apache::lonnet::hostname) { |
unless ($fh=Apache::File->new("$lontabdir/hosts.tab")) { |
if ($Apache::lonnet::hostname{$id} =~ /$reqhost/i) { |
$r->log_reason("Could not find host tab file"); |
my $filename=$r->filename; |
return FORBIDDEN; |
my $uri =$r->uri; |
} |
if ((-e "$filename.$id") || |
my $return; |
&subscribed($filename,$id) || |
my @ids=(); |
($filename=~/\.meta$/) || |
while ($readline=<$fh>) { |
($uri=~m|^/raw/uploaded|)) { |
my ($id,$domain,$role,$name,$ip)=split(/:/,$readline); |
return OK; |
if ($name =~ /$reqhost/i) { |
} else { |
my $filename=$r->filename; |
$return=FORBIDDEN; |
my $uri =$r->uri; |
push(@ids,$id); |
if ((-e "$filename.$id") || |
} |
&subscribed($filename,$id) || |
} |
($filename=~/\.meta$/) || |
} |
($uri=~m|^/raw/uploaded|)) { |
if ($return == FORBIDDEN) { |
return OK; |
$r->log_reason(join(':',@ids)." not subscribed", $r->filename); |
} else { |
return FORBIDDEN; |
$return=FORBIDDEN; |
|
push(@ids,$id); |
|
} |
|
} |
|
} |
|
if ($return == FORBIDDEN) { |
|
$r->log_reason(join(':',@ids)." not subscribed", $r->filename); |
|
return FORBIDDEN; |
|
} |
|
} |
} |
$r->log_reason("Invalid request for file transfer from $reqhost", |
$r->log_reason("Invalid request for file transfer from $reqhost", |
$r->filename); |
$r->filename); |