version 1.11, 2005/02/05 22:20:56
|
version 1.13, 2005/02/07 17:04:53
|
Line 32 use strict;
|
Line 32 use strict;
|
use Apache::Constants qw(:common :remotehost); |
use Apache::Constants qw(:common :remotehost); |
use Apache::lonnet(); |
use Apache::lonnet(); |
use Apache::File(); |
use Apache::File(); |
|
use IO::Socket; |
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
my $reqhost = $r->get_remote_host(REMOTE_HOST); |
my $reqhost = $r->get_remote_host(REMOTE_NOLOOKUP); |
|
my $netaddr=inet_aton($reqhost); |
|
($reqhost) = gethostbyaddr($netaddr,AF_INET); |
|
if (!$reqhost) { |
|
$r->log_reason("Unable to do hostname $reqhost lookup for ".$r->get_remote_host(REMOTE_NOLOOKUP)); |
|
return FORBIDDEN; |
|
} |
if ($reqhost eq 'localhost.localdomain') { |
if ($reqhost eq 'localhost.localdomain') { |
return OK; |
return OK; |
} |
} |