version 1.116, 2009/10/23 16:14:43
|
version 1.117, 2009/10/25 15:53:25
|
Line 320 sub handler {
|
Line 320 sub handler {
|
}], |
}], |
}, |
}, |
); |
); |
my %servers = &Apache::lonnet::get_servers($dom); |
my %servers = &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 617 sub print_login {
|
Line 617 sub print_login {
|
my $itemcount = 1; |
my $itemcount = 1; |
|
|
if ($position eq 'top') { |
if ($position eq 'top') { |
my %servers = &Apache::lonnet::get_servers($dom); |
my %servers = &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>'.$choices{'disallowlogin'}.'</td>'. |
$datatable .= '<tr'.$css_class.'><td>'.$choices{'disallowlogin'}.'</td>'. |
Line 3163 sub modify_login {
|
Line 3163 sub modify_login {
|
\%loginhash); |
\%loginhash); |
} |
} |
|
|
my %servers = &Apache::lonnet::get_servers($dom); |
my %servers = &dom_servers($dom); |
if (keys(%servers) > 1) { |
if (keys(%servers) > 1) { |
foreach my $lonhost (keys(%servers)) { |
foreach my $lonhost (keys(%servers)) { |
next if ($env{'form.'.$lonhost.'_serverurl'} eq $curr_loginvia{$lonhost}); |
next if ($env{'form.'.$lonhost.'_serverurl'} eq $curr_loginvia{$lonhost}); |
Line 5666 sub recurse_cat_deletes {
|
Line 5666 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; |
|
} |
|
|
1; |
1; |