version 1.86, 2007/01/13 20:39:57
|
version 1.89, 2007/03/08 01:58:48
|
Line 40 use Apache::migrateuser();
|
Line 40 use Apache::migrateuser();
|
use lib '/home/httpd/lib/perl/'; |
use lib '/home/httpd/lib/perl/'; |
use LONCAPA; |
use LONCAPA; |
|
|
|
|
sub additional_machine_domains { |
|
my @domains; |
|
open(my $fh,"<".$Apache::lonnet::perlvar{'lonTabDir'}.'/expected_domains.tab'); |
|
while( my $line = <$fh>) { |
|
$line =~ s/\s//g; |
|
push(@domains,$line); |
|
} |
|
return @domains; |
|
} |
|
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
|
|
Line 137 ENDFAILED
|
Line 126 ENDFAILED
|
} |
} |
my $iconpath= 'http://'.$ENV{'HTTP_HOST'}.':'.$port_to_use. |
my $iconpath= 'http://'.$ENV{'HTTP_HOST'}.':'.$port_to_use. |
$r->dir_config('lonIconsURL'); |
$r->dir_config('lonIconsURL'); |
my $domain = $r->dir_config('lonDefDomain'); |
my $domain = &Apache::lonnet::default_login_domain(); |
my $testdomain=(split(/\./,$ENV{'HTTP_HOST'}))[0]; |
|
foreach my $posdom (&Apache::lonnet::current_machine_domains(), |
|
&additional_machine_domains()) { |
|
if (lc($posdom) eq lc($testdomain)) { $domain=$posdom; } |
|
} |
|
if (($env{'form.domain'}) && |
if (($env{'form.domain'}) && |
($Apache::lonnet::domaindescription{$env{'form.domain'}})) { |
(&Apache::lonnet::domain($env{'form.domain'},'description'))) { |
$domain=$env{'form.domain'}; |
$domain=$env{'form.domain'}; |
} |
} |
my $role = $r->dir_config('lonRole'); |
my $role = $r->dir_config('lonRole'); |
Line 154 ENDFAILED
|
Line 138 ENDFAILED
|
my $include = $r->dir_config('lonIncludes'); |
my $include = $r->dir_config('lonIncludes'); |
my $expire = $r->dir_config('lonExpire'); |
my $expire = $r->dir_config('lonExpire'); |
my $version = $r->dir_config('lonVersion'); |
my $version = $r->dir_config('lonVersion'); |
my $host_name = $Apache::lonnet::hostname{$lonhost}; |
my $host_name = &Apache::lonnet::hostname($lonhost); |
|
|
# --------------------------------------------- Default values for login fields |
# --------------------------------------------- Default values for login fields |
|
|
Line 216 ENDFAILED
|
Line 200 ENDFAILED
|
my $last; |
my $last; |
foreach my $hostid (sort |
foreach my $hostid (sort |
{ |
{ |
$Apache::lonnet::hostname{$a} cmp |
&Apache::lonnet::hostname($a) cmp |
$Apache::lonnet::hostname{$b}; |
&Apache::lonnet::hostname($b); |
} |
} |
keys(%Apache::lonnet::spareid)) { |
keys(%Apache::lonnet::spareid)) { |
next if ($hostid eq $lonhost); |
next if ($hostid eq $lonhost); |
next if ($last eq $Apache::lonnet::hostname{$hostid}); |
my $hostname = &Apache::lonnet::hostname($hostid); |
|
next if ($last eq $hostname); |
$spares.='<br /><font size="+1"><a href="http://'. |
$spares.='<br /><font size="+1"><a href="http://'. |
$Apache::lonnet::hostname{$hostid}. |
$hostname. |
'/adm/login?domain='.$authdomain.'">'. |
'/adm/login?domain='.$authdomain.'">'. |
$Apache::lonnet::hostname{$hostid}.'</a>'. |
$hostname.'</a>'. |
' (preferred)</font>'.$/; |
' (preferred)</font>'.$/; |
$last=$Apache::lonnet::hostname{$hostid}; |
$last=$hostname; |
} |
} |
$spares.= '<br />'; |
$spares.= '<br />'; |
|
my %all_hostnames = &Apache::lonnet::all_hostnames(); |
foreach my $hostid (sort |
foreach my $hostid (sort |
{ |
{ |
$Apache::lonnet::hostname{$a} cmp |
&Apache::lonnet::hostname($a) cmp |
$Apache::lonnet::hostname{$b}; |
&Apache::lonnet::hostname($b); |
} |
} |
keys(%Apache::lonnet::hostname)) { |
keys(%all_hostnames)) { |
next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid}); |
next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid}); |
next if ($last eq $Apache::lonnet::hostname{$hostid}); |
my $hostname = &Apache::lonnet::hostname($hostid); |
|
next if ($last eq $hostname); |
$spares.='<br /><a href="http://'. |
$spares.='<br /><a href="http://'. |
$Apache::lonnet::hostname{$hostid}. |
$hostname. |
'/adm/login?domain='.$authdomain.'">'. |
'/adm/login?domain='.$authdomain.'">'. |
$Apache::lonnet::hostname{$hostid}.'</a>'; |
$hostname.'</a>'; |
$last=$Apache::lonnet::hostname{$hostid}; |
$last=$hostname; |
} |
} |
$r->print(<<ENDTROUBLE); |
$r->print(<<ENDTROUBLE); |
<html> |
<html> |