--- loncom/interface/domainprefs.pm 2009/10/06 18:24:29 1.111 +++ loncom/interface/domainprefs.pm 2009/10/06 21:54:50 1.112 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.111 2009/10/06 18:24:29 jms Exp $ +# $Id: domainprefs.pm,v 1.112 2009/10/06 21:54:50 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3139,6 +3139,14 @@ sub modify_login { newuser => 'Link for visitors to create a user account', loginheader => 'Log-in box header'); my @offon = ('off','on'); + my %curr_loginvia; + if (ref($domconfig{login}) eq 'HASH') { + if (ref($domconfig{login}{loginvia}) eq 'HASH') { + foreach my $lonhost (keys(%{$domconfig{login}{loginvia}})) { + $curr_loginvia{$lonhost} = $domconfig{login}{loginvia}{$lonhost}; + } + } + } my %loginhash; ($errors,%colchanges) = &modify_colors($r,$dom,$confname,['login'], \%domconfig,\%loginhash); @@ -3155,10 +3163,15 @@ sub modify_login { my %servers = &Apache::lonnet::get_servers($dom); if (keys(%servers) > 1) { foreach my $lonhost (keys(%servers)) { - if ($env{'form.'.$lonhost.'_serverurl'} ne '') { + next if ($env{'form.'.$lonhost.'_serverurl'} eq $curr_loginvia{$lonhost}); + next if ($env{'form.'.$lonhost.'_serverurl'} eq $lonhost); + if ($curr_loginvia{$lonhost} ne '') { + $loginhash{login}{loginvia}{$lonhost} = $env{'form.'.$lonhost.'_serverurl'}; + $changes{'loginvia'}{$lonhost} = 1; + } else { if (defined($servers{$env{'form.'.$lonhost.'_serverurl'}})) { $loginhash{login}{loginvia}{$lonhost} = $env{'form.'.$lonhost.'_serverurl'}; - $changes{$item} = 1; + $changes{'loginvia'}{$lonhost} = 1; } } } @@ -3210,6 +3223,18 @@ sub modify_login { foreach my $item (sort(keys(%changes))) { if ($item eq 'loginheader') { $resulttext .= '