version 1.148, 2011/08/02 03:11:48
|
version 1.149, 2011/08/09 00:54:43
|
Line 362 sub handler {
|
Line 362 sub handler {
|
col2 => 'Rules'}], |
col2 => 'Rules'}], |
}, |
}, |
); |
); |
my %servers = &dom_servers($dom); |
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
if (keys(%servers) > 1) { |
if (keys(%servers) > 1) { |
$prefs{'login'} = { text => 'Log-in page options', |
$prefs{'login'} = { text => 'Log-in page options', |
help => 'Domain_Configuration_Login_Page', |
help => 'Domain_Configuration_Login_Page', |
Line 707 sub print_login {
|
Line 707 sub print_login {
|
my %choices = &login_choices(); |
my %choices = &login_choices(); |
|
|
if ($position eq 'top') { |
if ($position eq 'top') { |
my %servers = &dom_servers($dom); |
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
my $choice = $choices{'disallowlogin'}; |
my $choice = $choices{'disallowlogin'}; |
$css_class = ' class="LC_odd_row"'; |
$css_class = ' class="LC_odd_row"'; |
$datatable .= '<tr'.$css_class.'><td>'.$choice.'</td>'. |
$datatable .= '<tr'.$css_class.'><td>'.$choice.'</td>'. |
Line 2307 sub print_usersessions {
|
Line 2307 sub print_usersessions {
|
|
|
my @alldoms = &Apache::lonnet::all_domains(); |
my @alldoms = &Apache::lonnet::all_domains(); |
my %uniques = &Apache::lonnet::get_unique_servers(\@alldoms); |
my %uniques = &Apache::lonnet::get_unique_servers(\@alldoms); |
my %servers = &dom_servers($dom); |
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
my $itemcount = 1; |
my $itemcount = 1; |
if ($position eq 'top') { |
if ($position eq 'top') { |
if (keys(%uniques) > 1) { |
if (keys(%uniques) > 1) { |
Line 3990 sub modify_login {
|
Line 3990 sub modify_login {
|
\%loginhash); |
\%loginhash); |
} |
} |
|
|
my %servers = &dom_servers($dom); |
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
my @loginvia_attribs = ('serverpath','custompath','exempt'); |
my @loginvia_attribs = ('serverpath','custompath','exempt'); |
if (keys(%servers) > 1) { |
if (keys(%servers) > 1) { |
foreach my $lonhost (keys(%servers)) { |
foreach my $lonhost (keys(%servers)) { |
Line 7062 sub modify_usersessions {
|
Line 7062 sub modify_usersessions {
|
|
|
my @alldoms = &Apache::lonnet::all_domains(); |
my @alldoms = &Apache::lonnet::all_domains(); |
my %uniques = &Apache::lonnet::get_unique_servers(\@alldoms); |
my %uniques = &Apache::lonnet::get_unique_servers(\@alldoms); |
my %servers = &dom_servers($dom); |
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
my %spareid = ¤t_offloads_to($dom,$domconfig{'usersessions'},\%servers); |
my %spareid = ¤t_offloads_to($dom,$domconfig{'usersessions'},\%servers); |
my $savespares; |
my $savespares; |
|
|
Line 7254 sub recurse_cat_deletes {
|
Line 7254 sub recurse_cat_deletes {
|
return; |
return; |
} |
} |
|
|
sub dom_servers { |
|
my ($dom) = @_; |
|
my (%uniqservers,%servers); |
|
my $primaryserver = &Apache::lonnet::hostname(&Apache::lonnet::domain($dom,'primary')); |
|
my @machinedoms = &Apache::lonnet::machine_domains($primaryserver); |
|
foreach my $mdom (@machinedoms) { |
|
my %currservers = %servers; |
|
my %server = &Apache::lonnet::get_servers($mdom); |
|
%servers = (%currservers,%server); |
|
} |
|
my %by_hostname; |
|
foreach my $id (keys(%servers)) { |
|
push(@{$by_hostname{$servers{$id}}},$id); |
|
} |
|
foreach my $hostname (sort(keys(%by_hostname))) { |
|
if (@{$by_hostname{$hostname}} > 1) { |
|
my $match = 0; |
|
foreach my $id (@{$by_hostname{$hostname}}) { |
|
if (&Apache::lonnet::host_domain($id) eq $dom) { |
|
$uniqservers{$id} = $hostname; |
|
$match = 1; |
|
} |
|
} |
|
unless ($match) { |
|
$uniqservers{$by_hostname{$hostname}[0]} = $hostname; |
|
} |
|
} else { |
|
$uniqservers{$by_hostname{$hostname}[0]} = $hostname; |
|
} |
|
} |
|
return %uniqservers; |
|
} |
|
|
|
sub get_active_dcs { |
sub get_active_dcs { |
my ($dom) = @_; |
my ($dom) = @_; |
my %dompersonnel = &Apache::lonnet::get_domain_roles($dom,['dc']); |
my %dompersonnel = &Apache::lonnet::get_domain_roles($dom,['dc']); |