version 1.111, 2009/10/06 18:24:29
|
version 1.112, 2009/10/06 21:54:50
|
Line 3139 sub modify_login {
|
Line 3139 sub modify_login {
|
newuser => 'Link for visitors to create a user account', |
newuser => 'Link for visitors to create a user account', |
loginheader => 'Log-in box header'); |
loginheader => 'Log-in box header'); |
my @offon = ('off','on'); |
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; |
my %loginhash; |
($errors,%colchanges) = &modify_colors($r,$dom,$confname,['login'], |
($errors,%colchanges) = &modify_colors($r,$dom,$confname,['login'], |
\%domconfig,\%loginhash); |
\%domconfig,\%loginhash); |
Line 3155 sub modify_login {
|
Line 3163 sub modify_login {
|
my %servers = &Apache::lonnet::get_servers($dom); |
my %servers = &Apache::lonnet::get_servers($dom); |
if (keys(%servers) > 1) { |
if (keys(%servers) > 1) { |
foreach my $lonhost (keys(%servers)) { |
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'}})) { |
if (defined($servers{$env{'form.'.$lonhost.'_serverurl'}})) { |
$loginhash{login}{loginvia}{$lonhost} = $env{'form.'.$lonhost.'_serverurl'}; |
$loginhash{login}{loginvia}{$lonhost} = $env{'form.'.$lonhost.'_serverurl'}; |
$changes{$item} = 1; |
$changes{'loginvia'}{$lonhost} = 1; |
} |
} |
} |
} |
} |
} |
Line 3210 sub modify_login {
|
Line 3223 sub modify_login {
|
foreach my $item (sort(keys(%changes))) { |
foreach my $item (sort(keys(%changes))) { |
if ($item eq 'loginheader') { |
if ($item eq 'loginheader') { |
$resulttext .= '<li>'.&mt("$title{$item} set to $env{'form.loginheader'}").'</li>'; |
$resulttext .= '<li>'.&mt("$title{$item} set to $env{'form.loginheader'}").'</li>'; |
|
} elsif ($item eq 'loginvia') { |
|
if (ref($changes{$item}) eq 'HASH') { |
|
$resulttext .= '<li>'.&mt('Log-in page availability:').'<ul>'; |
|
foreach my $lonhost (sort(keys(%{$changes{$item}}))) { |
|
if ($servers{$env{'form.'.$lonhost.'_serverurl'}} ne '') { |
|
$resulttext .= '<li>'.&mt('Server: [_1] log-in page now redirects to [_2]',$lonhost,$servers{$env{'form.'.$lonhost.'_serverurl'}}).'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('Server: [_1] now has standard log-in page.',$lonhost).'</li>'; |
|
} |
|
} |
|
$resulttext .= '</ul></li>'; |
|
} |
} else { |
} else { |
$resulttext .= '<li>'.&mt("$title{$item} set to $offon[$env{'form.'.$item}]").'</li>'; |
$resulttext .= '<li>'.&mt("$title{$item} set to $offon[$env{'form.'.$item}]").'</li>'; |
} |
} |