--- loncom/interface/domainprefs.pm 2011/08/02 03:11:48 1.148
+++ loncom/interface/domainprefs.pm 2011/08/09 00:54:43 1.149
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.148 2011/08/02 03:11:48 raeburn Exp $
+# $Id: domainprefs.pm,v 1.149 2011/08/09 00:54:43 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -362,7 +362,7 @@ sub handler {
col2 => 'Rules'}],
},
);
- my %servers = &dom_servers($dom);
+ my %servers = &Apache::lonnet::internet_dom_servers($dom);
if (keys(%servers) > 1) {
$prefs{'login'} = { text => 'Log-in page options',
help => 'Domain_Configuration_Login_Page',
@@ -707,7 +707,7 @@ sub print_login {
my %choices = &login_choices();
if ($position eq 'top') {
- my %servers = &dom_servers($dom);
+ my %servers = &Apache::lonnet::internet_dom_servers($dom);
my $choice = $choices{'disallowlogin'};
$css_class = ' class="LC_odd_row"';
$datatable .= '
'.$choice.' | '.
@@ -2307,7 +2307,7 @@ sub print_usersessions {
my @alldoms = &Apache::lonnet::all_domains();
my %uniques = &Apache::lonnet::get_unique_servers(\@alldoms);
- my %servers = &dom_servers($dom);
+ my %servers = &Apache::lonnet::internet_dom_servers($dom);
my $itemcount = 1;
if ($position eq 'top') {
if (keys(%uniques) > 1) {
@@ -3990,7 +3990,7 @@ sub modify_login {
\%loginhash);
}
- my %servers = &dom_servers($dom);
+ my %servers = &Apache::lonnet::internet_dom_servers($dom);
my @loginvia_attribs = ('serverpath','custompath','exempt');
if (keys(%servers) > 1) {
foreach my $lonhost (keys(%servers)) {
@@ -7062,7 +7062,7 @@ sub modify_usersessions {
my @alldoms = &Apache::lonnet::all_domains();
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 $savespares;
@@ -7254,39 +7254,6 @@ sub recurse_cat_deletes {
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 {
my ($dom) = @_;
my %dompersonnel = &Apache::lonnet::get_domain_roles($dom,['dc']);