version 1.1347, 2017/08/07 20:22:54
|
version 1.1348, 2017/08/08 15:33:13
|
Line 1598 sub internet_dom_servers {
|
Line 1598 sub internet_dom_servers {
|
return %uniqservers; |
return %uniqservers; |
} |
} |
|
|
sub notcallable { |
|
my ($cmdtype,$calldom) = @_; |
|
if (&domain($calldom) eq '') { |
|
return 1; |
|
} |
|
unless ($cmdtype =~ /^(content|shared|enroll|coaurem|domroles|catalog|reqcrs|msg)$/) { |
|
return 1; |
|
} |
|
my @machinedoms = ¤t_machine_domains(); |
|
if (grep(/^\Q$calldom\E$/,@machinedoms)) { |
|
return; |
|
} |
|
my $reject; |
|
my $intdom = &internet_dom($perlvar{'lonHostID'}); |
|
if ($intdom eq '') { |
|
return 1; |
|
} |
|
my $callprimary = &domain($calldom,'primary'); |
|
my $intcalldom = &Apache::lonnet::internet_dom($callprimary); |
|
unless ($intdom eq $intcalldom) { |
|
my ($trustconfig,$cached)=&Apache::lonnet::is_cached_new('trust',$calldom); |
|
unless (defined($cached)) { |
|
my %domconfig = &Apache::lonnet::get_dom('configuration',['trust'],$calldom); |
|
&Apache::lonnet::do_cache_new('trust',$calldom,$domconfig{'trust'},3600); |
|
$trustconfig = $domconfig{'trust'}; |
|
} |
|
if (ref($trustconfig)) { |
|
if (ref($trustconfig->{$cmdtype}) eq 'HASH') { |
|
if (ref($trustconfig->{$cmdtype}->{'exc'}) eq 'ARRAY') { |
|
if (grep(/^\Q$intdom\E$/,@{$trustconfig->{$cmdtype}->{'exc'}})) { |
|
$reject = 1; |
|
} |
|
} |
|
if (ref($trustconfig->{$cmdtype}->{'inc'}) eq 'ARRAY') { |
|
if (grep(/^\Q$intdom\E$/,@{$trustconfig->{$cmdtype}->{'inc'}})) { |
|
$reject = 0; |
|
} else { |
|
$reject = 1; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
return $reject; |
|
} |
|
|
|
sub trusted_domains { |
sub trusted_domains { |
my ($cmdtype,$calldom) = @_; |
my ($cmdtype,$calldom) = @_; |
my (%trusted,%untrusted); |
my (%trusted,%untrusted); |