version 1.19, 2007/02/01 06:31:33
|
version 1.22, 2007/03/02 23:43:29
|
Line 37 use IO::Socket;
|
Line 37 use IO::Socket;
|
sub subscribed { |
sub subscribed { |
my ($filename,$id) = @_; |
my ($filename,$id) = @_; |
|
|
return 0 if (-e "$filename.subscription"); |
return 0 if (!-e "$filename.subscription"); |
|
|
my $hostname=$Apache::lonnet::hostname{$id}; |
my $hostname=&Apache::lonnet::hostname($id); |
my (undef,undef,undef,undef,$ip) = gethostbyname($hostname); |
my (undef,undef,undef,undef,$ip) = gethostbyname($hostname); |
|
|
return 0 if (length($ip) != 4); |
return 0 if (length($ip) != 4); |
Line 65 sub handler {
|
Line 65 sub handler {
|
} |
} |
|
|
my $reqhost = $r->get_remote_host(REMOTE_NOLOOKUP); |
my $reqhost = $r->get_remote_host(REMOTE_NOLOOKUP); |
my %iphost=&Apache::lonnet::get_iphost(); |
my @hostids= &Apache::lonnet::get_hosts_from_ip($reqhost); |
my $hostids=$iphost{$reqhost}; |
if (!@hostids && $reqhost ne '127.0.0.1' ) { |
if (!$hostids && $reqhost ne '127.0.0.1' ) { |
|
$r->log_reason("Unable to find a host for ". |
$r->log_reason("Unable to find a host for ". |
$r->get_remote_host(REMOTE_NOLOOKUP)); |
$r->get_remote_host(REMOTE_NOLOOKUP)); |
return FORBIDDEN; |
return FORBIDDEN; |
Line 78 sub handler {
|
Line 77 sub handler {
|
my $return; |
my $return; |
my @ids; |
my @ids; |
|
|
foreach my $id (@{$hostids}) { |
foreach my $id (@hostids) { |
my $uri =$r->uri; |
my $uri =$r->uri; |
if (($filename=~/\.meta$/) || |
if (($filename=~/\.meta$/) || |
($uri=~m|^/raw/uploaded|) || |
($uri=~m|^/raw/uploaded|) || |