version 1.105, 2010/07/17 20:02:02
|
version 1.106, 2010/07/20 02:42:33
|
Line 421 sub check_can_host {
|
Line 421 sub check_can_host {
|
my ($r,$form,$authhost,$domdesc) = @_; |
my ($r,$form,$authhost,$domdesc) = @_; |
return unless (ref($form) eq 'HASH'); |
return unless (ref($form) eq 'HASH'); |
my $canhost = 1; |
my $canhost = 1; |
my @machinedoms = &Apache::lonnet::current_machine_domains(); |
my $lonhost = $r->dir_config('lonHostID'); |
my $udom = $form->{'udom'}; |
my $udom = $form->{'udom'}; |
unless (grep(/^\Q$udom\E/,@machinedoms)) { |
my @intdoms = &Apache::lonnet::get_internet_names($lonhost); |
my $defdom = &Apache::lonnet::default_login_domain(); |
my $uprimary_id = &Apache::lonnet::domain($udom,'primary'); |
my %defdomdefaults = &Apache::lonnet::get_domain_defaults($defdom); |
my $uint_dom = &Apache::lonnet::internet_dom($uprimary_id); |
|
unless ($uint_dom ne '' && grep(/^\Q$uint_dom\E$/,@intdoms)) { |
|
my $machine_dom = &Apache::lonnet::host_domain($lonhost); |
|
my $hostname = &Apache::lonnet::hostname($lonhost); |
|
my $serverhomeID = &Apache::lonnet::get_server_homeID($hostname); |
|
my $serverhomedom = &Apache::lonnet::host_domain($serverhomeID); |
|
my %defdomdefaults = &Apache::lonnet::get_domain_defaults($serverhomedom); |
my %udomdefaults = &Apache::lonnet::get_domain_defaults($udom); |
my %udomdefaults = &Apache::lonnet::get_domain_defaults($udom); |
my $loncaparev; |
my $loncaparev; |
if ($authhost eq 'no_account_on_host') { |
if ($authhost eq 'no_account_on_host') { |
$loncaparev = &Apache::lonnet::get_server_loncaparev($defdom); |
$loncaparev = &Apache::lonnet::get_server_loncaparev($machine_dom); |
} else { |
} else { |
$loncaparev = &Apache::lonnet::get_server_loncaparev($defdom,$authhost); |
$loncaparev = &Apache::lonnet::get_server_loncaparev($machine_dom,$lonhost); |
} |
} |
$canhost = &Apache::lonnet::can_host_session($udom,$defdom,$loncaparev,$udomdefaults{'remotesessions'},$defdomdefaults{'hostedsessions'}); |
$canhost = &Apache::lonnet::can_host_session($udom,$lonhost,$loncaparev, |
|
$udomdefaults{'remotesessions'}, |
|
$defdomdefaults{'hostedsessions'}); |
} |
} |
unless ($canhost) { |
unless ($canhost) { |
if ($authhost eq 'no_account_on_host') { |
if ($authhost eq 'no_account_on_host') { |