version 1.14, 2015/05/04 15:43:57
|
version 1.14.2.2, 2021/01/04 03:57:04
|
Line 92 sub check_ipbased_access {
|
Line 92 sub check_ipbased_access {
|
my ($page,$ip) = @_; |
my ($page,$ip) = @_; |
my $allowed; |
my $allowed; |
if (!defined($ip)) { |
if (!defined($ip)) { |
$ip = $ENV{'REMOTE_ADDR'}; |
$ip = &Apache::lonnet::get_requestor_ip(); |
} |
} |
if ($ip eq '127.0.0.1') { |
if ($ip eq '127.0.0.1') { |
$allowed = 1; |
$allowed = 1; |
Line 197 sub check_domain_ip {
|
Line 197 sub check_domain_ip {
|
my %remote_doms; |
my %remote_doms; |
my $allowed; |
my $allowed; |
if ($remote_ip ne '') { |
if ($remote_ip ne '') { |
if (&Apache::lonnet::hostname($remote_ip) ne '') { |
my @remote_hosts = &Apache::lonnet::get_hosts_from_ip($remote_ip); |
|
if (@remote_hosts) { |
my @poss_domains = &Apache::lonnet::current_machine_domains(); |
my @poss_domains = &Apache::lonnet::current_machine_domains(); |
if (@poss_domains > 0) { |
if (@poss_domains > 0) { |
my @remote_hosts = &Apache::lonnet::get_hosts_from_ip($remote_ip); |
|
foreach my $hostid (@remote_hosts) { |
foreach my $hostid (@remote_hosts) { |
my $hostdom = &Apache::lonnet::host_domain($hostid); |
my $hostdom = &Apache::lonnet::host_domain($hostid); |
if ($hostdom ne '') { |
if ($hostdom ne '') { |