version 1.62.2.1, 2005/02/21 18:29:25
|
version 1.63, 2005/04/07 06:56:21
|
Line 32 use strict;
|
Line 32 use strict;
|
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
use CGI::Cookie(); |
use CGI::Cookie(); |
use Apache::File (); |
use Apache::File (); |
use Apache::lonnet(); |
use Apache::lonnet; |
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonauth(); |
use Apache::lonauth(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
Line 84 ENDFAILED
|
Line 84 ENDFAILED
|
# ---------------------------------------------------- No valid token, continue |
# ---------------------------------------------------- No valid token, continue |
|
|
&Apache::loncommon::get_unprocessed_cgi |
&Apache::loncommon::get_unprocessed_cgi |
($ENV{'QUERY_STRING'}.'&'.$ENV{'request.querystring'}, |
($ENV{'QUERY_STRING'}.'&'.$env{'request.querystring'}, |
['interface','username','domain','firsturl','localpath','localres']); |
['interface','username','domain','firsturl','localpath','localres']); |
|
|
|
|
# ----------------------------------------------------------- Process Interface |
# ----------------------------------------------------------- Process Interface |
$ENV{'form.interface'}=~s/\W//g; |
$env{'form.interface'}=~s/\W//g; |
|
|
my $textbrowsers=$r->dir_config('lonTextBrowsers'); |
my $textbrowsers=$r->dir_config('lonTextBrowsers'); |
my $httpbrowser=$ENV{"HTTP_USER_AGENT"}; |
my $httpbrowser=$ENV{"HTTP_USER_AGENT"}; |
|
|
foreach (split(/\:/,$textbrowsers)) { |
foreach (split(/\:/,$textbrowsers)) { |
if ($httpbrowser=~/$_/i) { |
if ($httpbrowser=~/$_/i) { |
$ENV{'form.interface'}='textual'; |
$env{'form.interface'}='textual'; |
} |
} |
} |
} |
|
|
my $fullgraph=($ENV{'form.interface'} ne 'textual'); |
my $fullgraph=($env{'form.interface'} ne 'textual'); |
my $port_to_use=$r->dir_config('lonhttpdPort'); |
my $port_to_use=$r->dir_config('lonhttpdPort'); |
if (!defined($port_to_use)) { |
if (!defined($port_to_use)) { |
$port_to_use='8080'; |
$port_to_use='8080'; |
Line 108 ENDFAILED
|
Line 108 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 = $r->dir_config('lonDefDomain'); |
if (($ENV{'form.domain'}) && |
if (($env{'form.domain'}) && |
($Apache::lonnet::domaindescription{$ENV{'form.domain'}})) { |
($Apache::lonnet::domaindescription{$env{'form.domain'}})) { |
$domain=$ENV{'form.domain'}; |
$domain=$env{'form.domain'}; |
} |
} |
my $role = $r->dir_config('lonRole'); |
my $role = $r->dir_config('lonRole'); |
my $loadlim = $r->dir_config('lonLoadLim'); |
my $loadlim = $r->dir_config('lonLoadLim'); |
Line 124 ENDFAILED
|
Line 124 ENDFAILED
|
|
|
# --------------------------------------------- Default values for login fields |
# --------------------------------------------- Default values for login fields |
|
|
my $authusername=($ENV{'form.username'}?$ENV{'form.username'}:''); |
my $authusername=($env{'form.username'}?$env{'form.username'}:''); |
my $authdomain=($ENV{'form.domain'}?$ENV{'form.domain'}:$domain); |
my $authdomain=($env{'form.domain'}?$env{'form.domain'}:$domain); |
|
|
# ---------------------------------------------------------- Determine own load |
# ---------------------------------------------------------- Determine own load |
my $loadavg; |
my $loadavg; |
Line 140 ENDFAILED
|
Line 140 ENDFAILED
|
# ------------------------------------------------------- Do the load balancing |
# ------------------------------------------------------- Do the load balancing |
my $otherserver='http://'.$ENV{'SERVER_NAME'}; |
my $otherserver='http://'.$ENV{'SERVER_NAME'}; |
my $firsturl= |
my $firsturl= |
($ENV{'request.firsturl'}?$ENV{'request.firsturl'}:$ENV{'form.firsturl'}); |
($env{'request.firsturl'}?$env{'request.firsturl'}:$env{'form.firsturl'}); |
my $escfirsturl=&Apache::lonnet::escape($firsturl); |
|
# ---------------------------------------- Are we access server and overloaded? |
# ---------------------------------------- Are we access server and overloaded? |
if (($role eq 'access') && |
if (($role eq 'access') && |
(($userloadpercent>100.0)||($loadpercent>100.0))) { |
(($userloadpercent>100.0)||($loadpercent>100.0))) { |
Line 322 ENDSCRIPT
|
Line 321 ENDSCRIPT
|
<form name="server" action="$otherserver/adm/authenticate" method="post" target="_top"> |
<form name="server" action="$otherserver/adm/authenticate" method="post" target="_top"> |
<input type="hidden" name="logtoken" value="$logtoken" /> |
<input type="hidden" name="logtoken" value="$logtoken" /> |
<input type="hidden" name="serverid" value="$lonhost" /> |
<input type="hidden" name="serverid" value="$lonhost" /> |
<input type="hidden" name="interface" value="$ENV{'form.interface'}" /> |
<input type="hidden" name="interface" value="$env{'form.interface'}" /> |
<input type="hidden" name="uname" value="" /> |
<input type="hidden" name="uname" value="" /> |
<input type="hidden" name="upass" value="" /> |
<input type="hidden" name="upass" value="" /> |
<input type="hidden" name="udom" value="" /> |
<input type="hidden" name="udom" value="" /> |
Line 332 ENDSCRIPT
|
Line 331 ENDSCRIPT
|
<input type="hidden" name="fontenhance" value="" /> |
<input type="hidden" name="fontenhance" value="" /> |
<input type="hidden" name="blackwhite" value="" /> |
<input type="hidden" name="blackwhite" value="" /> |
<input type="hidden" name="remember" value="" /> |
<input type="hidden" name="remember" value="" /> |
<input type="hidden" name="localpath" value="$ENV{'form.localpath'}" /> |
<input type="hidden" name="localpath" value="$env{'form.localpath'}" /> |
<input type="hidden" name="localres" value="$ENV{'form.localres'}" /> |
<input type="hidden" name="localres" value="$env{'form.localres'}" /> |
</form> |
</form> |
ENDSERVERFORM |
ENDSERVERFORM |
if ($fullgraph) { $r->print(<<ENDTOP); |
if ($fullgraph) { $r->print(<<ENDTOP); |
Line 341 ENDSERVERFORM
|
Line 340 ENDSERVERFORM
|
<tr> |
<tr> |
|
|
<!-- Row 1 Columns 2-4 --> |
<!-- Row 1 Columns 2-4 --> |
<td width="100%" colspan=4 bgcolor="$sidebg"><h1><font color="$pgbg">Welcome to the LON-CAPA NSDL Gateway</font></h1><a href="/cgi-bin/signon.pl?$escfirsturl"><h3><font color="$pgbg">Sign up for a Guest Login</font></h3></a></td> |
<td width="100%" height=75 colspan=4 align="left" valign="top" bgcolor="$pgbg"><img src="$img" border=0 alt="The Learning Online Network with CAPA" /></td> |
</tr> |
</tr> |
|
|
<!-- The gray bar that starts the two table frames --> |
<!-- The gray bar that starts the two table frames --> |