version 1.30, 2003/02/04 15:11:44
|
version 1.32, 2003/02/17 23:25:59
|
Line 50 sub handler {
|
Line 50 sub handler {
|
|
|
|
|
&Apache::loncommon::get_unprocessed_cgi |
&Apache::loncommon::get_unprocessed_cgi |
($ENV{'QUERY_STRING'},['interface','username','domain']); |
($ENV{'QUERY_STRING'},['interface','username','domain','firsturl']); |
|
|
|
# ----------------------------------------------------------- Process Interface |
$ENV{'form.interface'}=~s/\W//g; |
$ENV{'form.interface'}=~s/\W//g; |
|
|
|
my $textbrowsers=$r->dir_config('lonTextBrowsers'); |
|
my $httpbrowser=$ENV{"HTTP_USER_AGENT"}; |
|
|
|
foreach (split(/\:/,$textbrowsers)) { |
|
if ($httpbrowser=~/$_/i) { |
|
$ENV{'form.interface'}='textual'; |
|
} |
|
} |
|
|
my $fullgraph=($ENV{'form.interface'} ne 'textual'); |
my $fullgraph=($ENV{'form.interface'} ne 'textual'); |
|
|
my $iconpath= 'http://'.$ENV{'HTTP_HOST'}.':8080'. |
my $iconpath= 'http://'.$ENV{'HTTP_HOST'}.':8080'. |
Line 83 sub handler {
|
Line 93 sub handler {
|
|
|
# ------------------------------------------------------- Do the load balancing |
# ------------------------------------------------------- Do the load balancing |
my $otherserver='http://'.$ENV{'SERVER_NAME'}; |
my $otherserver='http://'.$ENV{'SERVER_NAME'}; |
my $firsturl=$ENV{'request.firsturl'}; |
my $firsturl= |
|
($ENV{'request.firsturl'}?$ENV{'request.firsturl'}:$ENV{'form.firsturl'}); |
# ---------------------------------------- Are we access server and overloaded? |
# ---------------------------------------- Are we access server and overloaded? |
if (($role eq 'access') && ($loadpercent>100.0)) { |
if (($role eq 'access') && ($loadpercent>100.0)) { |
$otherserver=Apache::lonnet::spareserver($loadpercent); |
$otherserver=Apache::lonnet::spareserver($loadpercent); |
Line 109 sub handler {
|
Line 120 sub handler {
|
my $uextkey=hex($ukey); |
my $uextkey=hex($ukey); |
if ($uextkey>2147483647) { $uextkey-=4294967296; } |
if ($uextkey>2147483647) { $uextkey-=4294967296; } |
|
|
|
# -------------------------------------------------------- Store away log token |
my $logtoken=Apache::lonnet::reply( |
my $logtoken=Apache::lonnet::reply( |
'tmpput:'.$ukey.$lkey.'&'.$firsturl, |
'tmpput:'.$ukey.$lkey.'&'.$firsturl, |
$lonhost); |
$lonhost); |
|
|
|
# ------------------- If we cannot talk to ourselves, we are in serious trouble |
|
|
|
if ($logtoken eq 'con_lost') { |
|
my $spares=''; |
|
foreach (keys %Apache::lonnet::hostname) { |
|
if ($_ ne $lonhost) { |
|
$spares.='<br /><a href="http://'.$Apache::lonnet::hostname{$_}. |
|
'/adm/login?domain='.$authdomain.'">'. |
|
$Apache::lonnet::hostname{$_}.'</a>'; |
|
if ($Apache::lonnet::spareid{$_}) { |
|
$spares.=' (preferred)'; |
|
} |
|
} |
|
} |
|
$r->print(<<ENDTROUBLE); |
|
<html> |
|
<head><title>The LearningOnline Network with CAPA</title></head> |
|
<body bgcolor="#FFFFFF"> |
|
<img src="/adm/lonKaputt/lonlogo_broken.gif" align="right" /> |
|
<h3>This LON-CAPA server is temporarily not available for login</h3> |
|
<p>Please attempt to login to one of the following servers:</p>$spares |
|
<p>If the problem persists, please contact <tt>$servadm</tt>.</p> |
|
</body> |
|
</html> |
|
ENDTROUBLE |
|
return OK; |
|
} |
|
|
|
# ----------------------------------------------- Apparently we are in business |
|
|
my $domainlogo=&Apache::loncommon::domainlogo(); |
my $domainlogo=&Apache::loncommon::domainlogo(); |
# --------------------------------------------------- Print login screen header |
# --------------------------------------------------- Print login screen header |
$r->print(<<ENDHEADER); |
$r->print(<<ENDHEADER); |
Line 235 ENDSERVERFORM
|
Line 278 ENDSERVERFORM
|
<!-- Row 4 Column 1 --> |
<!-- Row 4 Column 1 --> |
<td align="center" valign="middle" bgcolor="$sidebg"> |
<td align="center" valign="middle" bgcolor="$sidebg"> |
ENDTOP |
ENDTOP |
|
} else { |
|
$r->print('<font color="#FFFFFF"><h1>The Learning<i>Online</i> Network with CAPA</h1><h3>Text-based Interface Login</h3></font>'); |
} |
} |
$r->print(<<ENDLOGIN); |
$r->print(<<ENDLOGIN); |
<form name="client" onsubmit="return(send())"> |
<form name="client" onsubmit="return(send())"> |