version 1.51, 2003/09/17 02:24:14
|
version 1.93, 2007/04/17 15:44:58
|
Line 25
|
Line 25
|
# |
# |
# http://www.lon-capa.org/ |
# http://www.lon-capa.org/ |
# |
# |
# 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14, |
|
# 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9, |
|
# 1/17/01 Gerd Kortemeyer |
|
# |
|
# 2/7/02,2/8,2/12,2/14,2/15,2/19 Josh Brunskole |
|
# |
|
# 7/10/02 Jeremy Bowers |
|
|
|
package Apache::lonlogin; |
package Apache::lonlogin; |
|
|
use strict; |
use strict; |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
|
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; |
|
use Apache::migrateuser(); |
|
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA; |
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
$r->content_type('text/html'); |
|
|
&Apache::loncommon::get_unprocessed_cgi |
|
(join('&',$ENV{'QUERY_STRING'},$env{'request.querystring'}, |
|
$ENV{'REDIRECT_QUERY_STRING'}), |
|
['interface','username','domain','firsturl','localpath','localres', |
|
'token']); |
|
|
|
# -- check if they are a migrating user |
|
if (defined($env{'form.token'})) { |
|
return &Apache::migrateuser::handler($r); |
|
} |
|
|
&Apache::loncommon::no_cache($r); |
&Apache::loncommon::no_cache($r); |
|
&Apache::lonlocal::get_language_handle($r); |
|
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
return OK if $r->header_only; |
return OK if $r->header_only; |
|
|
Line 57 sub handler {
|
Line 67 sub handler {
|
return OK; |
return OK; |
} |
} |
|
|
&Apache::loncommon::get_unprocessed_cgi |
|
($ENV{'QUERY_STRING'}.'&'.$ENV{'request.querystring'}, |
|
['interface','username','domain','firsturl','localpath','localres']); |
|
|
|
# -------------------------------------------------------------------- Language |
|
|
|
&Apache::lonlocal::get_language_handle(); |
|
|
|
|
# -------------------------------- Prevent users from attempting to login twice |
|
my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); |
|
my $lonid=$cookies{'lonID'}; |
|
my $cookie; |
|
if ($lonid) { |
|
my $handle=&LONCAPA::clean_handle($lonid->value); |
|
my $lonidsdir=$r->dir_config('lonIDsDir'); |
|
if (-e "$lonidsdir/$handle.id") { |
|
# Is there an existing token file? |
|
if ($handle=~/^publicuser\_/) { |
|
# For "public user" - remove it, we apparently really want to login |
|
unlink("$lonidsdir/$handle.id"); |
|
} elsif ($handle ne '') { |
|
# Indeed, a valid token is found |
|
my $start_page = |
|
&Apache::loncommon::start_page('Already logged in'); |
|
my $end_page = |
|
&Apache::loncommon::end_page(); |
|
$r->print(<<ENDFAILED); |
|
$start_page |
|
<h1>You are already logged in</h1> |
|
<p>Please either <a href="/adm/roles">continue the current session</a> or |
|
<a href="/adm/logout">logout</a>.</p> |
|
<p> |
|
<a href="/adm/loginproblems.html">Problems?</a></p> |
|
$end_page |
|
ENDFAILED |
|
return OK; |
|
} |
|
} |
|
} |
|
|
|
# ---------------------------------------------------- No valid token, continue |
|
|
|
# ---------------------------- Not possible to really login to domain "public" |
|
if ($env{'form.domain'} eq 'public') { |
|
$env{'form.domain'}=''; |
|
$env{'form.username'}=''; |
|
} |
# ----------------------------------------------------------- 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'; |
} |
} |
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(); |
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'); |
my $loadlim = $r->dir_config('lonLoadLim'); |
my $loadlim = $r->dir_config('lonLoadLim'); |
my $servadm = $r->dir_config('lonAdmEMail'); |
my $servadm = $r->dir_config('lonAdmEMail'); |
my $sysadm = $r->dir_config('lonSysEMail'); |
|
my $lonhost = $r->dir_config('lonHostID'); |
my $lonhost = $r->dir_config('lonHostID'); |
my $tabdir = $r->dir_config('lonTabDir'); |
my $tabdir = $r->dir_config('lonTabDir'); |
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); |
|
|
# --------------------------------------------- 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 111 sub handler {
|
Line 153 sub handler {
|
$loadavg=<$loadfile>; |
$loadavg=<$loadfile>; |
} |
} |
$loadavg =~ s/\s.*//g; |
$loadavg =~ s/\s.*//g; |
my $loadpercent=100*$loadavg/$loadlim; |
my $loadpercent=sprintf("%.1f",100*$loadavg/$loadlim); |
my $userloadpercent=&Apache::lonnet::userload(); |
my $userloadpercent=&Apache::lonnet::userload(); |
|
|
# ------------------------------------------------------- Do the load balancing |
# ------------------------------------------------------- Do the load balancing |
my $otherserver='http://'.$ENV{'SERVER_NAME'}; |
my $otherserver= &Apache::lonnet::absolute_url($host_name); |
my $firsturl= |
my $firsturl= |
($ENV{'request.firsturl'}?$ENV{'request.firsturl'}:$ENV{'form.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') && |
if (($role eq 'access') && |
(($userloadpercent>100.0)||($loadpercent>100.0))) { |
(($userloadpercent>100.0)||($loadpercent>100.0))) { |
Line 156 sub handler {
|
Line 198 sub handler {
|
|
|
if ($logtoken eq 'con_lost') { |
if ($logtoken eq 'con_lost') { |
my $spares=''; |
my $spares=''; |
foreach (keys %Apache::lonnet::hostname) { |
my $last; |
if ($_ ne $lonhost) { |
foreach my $hostid (sort |
$spares.='<br /><a href="http://'.$Apache::lonnet::hostname{$_}. |
{ |
'/adm/login?domain='.$authdomain.'">'. |
&Apache::lonnet::hostname($a) cmp |
$Apache::lonnet::hostname{$_}.'</a>'; |
&Apache::lonnet::hostname($b); |
if ($Apache::lonnet::spareid{$_}) { |
} |
$spares.=' (preferred)'; |
keys(%Apache::lonnet::spareid)) { |
} |
next if ($hostid eq $lonhost); |
} |
my $hostname = &Apache::lonnet::hostname($hostid); |
|
next if ($last eq $hostname); |
|
$spares.='<br /><font size="+1"><a href="http://'. |
|
$hostname. |
|
'/adm/login?domain='.$authdomain.'">'. |
|
$hostname.'</a>'. |
|
' (preferred)</font>'.$/; |
|
$last=$hostname; |
|
} |
|
$spares.= '<br />'; |
|
my %all_hostnames = &Apache::lonnet::all_hostnames(); |
|
foreach my $hostid (sort |
|
{ |
|
&Apache::lonnet::hostname($a) cmp |
|
&Apache::lonnet::hostname($b); |
|
} |
|
keys(%all_hostnames)) { |
|
next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid}); |
|
my $hostname = &Apache::lonnet::hostname($hostid); |
|
next if ($last eq $hostname); |
|
$spares.='<br /><a href="http://'. |
|
$hostname. |
|
'/adm/login?domain='.$authdomain.'">'. |
|
$hostname.'</a>'; |
|
$last=$hostname; |
} |
} |
$r->print(<<ENDTROUBLE); |
$r->print(<<ENDTROUBLE); |
<html> |
<html> |
Line 173 sub handler {
|
Line 239 sub handler {
|
<img src="/adm/lonKaputt/lonlogo_broken.gif" align="right" /> |
<img src="/adm/lonKaputt/lonlogo_broken.gif" align="right" /> |
<h3>This LON-CAPA server is temporarily not available for login</h3> |
<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>Please attempt to login to one of the following servers:</p>$spares |
<p>If the problem persists, please contact <tt>$servadm</tt>.</p> |
|
</body> |
</body> |
</html> |
</html> |
ENDTROUBLE |
ENDTROUBLE |
Line 181 ENDTROUBLE
|
Line 246 ENDTROUBLE
|
} |
} |
|
|
# ----------------------------------------------- Apparently we are in business |
# ----------------------------------------------- Apparently we are in business |
|
|
my $domainlogo=&Apache::loncommon::domainlogo($domain); |
|
$servadm=~s/\,/\<br \/\>/g; |
$servadm=~s/\,/\<br \/\>/g; |
$sysadm=~s/\,/\<br \/\>/g; |
|
|
|
# --------------------------------------------------- Print login screen header |
# --------------------------------------------------- Print login screen header |
$r->print(<<ENDHEADER); |
$r->print(<<ENDHEADER); |
Line 216 ENDHEADER
|
Line 278 ENDHEADER
|
($fullgraph?&Apache::loncommon::designparm('login.sidebg',$domain):'#FFFFFF'); |
($fullgraph?&Apache::loncommon::designparm('login.sidebg',$domain):'#FFFFFF'); |
my $logo=&Apache::loncommon::designparm('login.logo',$domain); |
my $logo=&Apache::loncommon::designparm('login.logo',$domain); |
my $img=&Apache::loncommon::designparm('login.img',$domain); |
my $img=&Apache::loncommon::designparm('login.img',$domain); |
|
my $domainlogo=&Apache::loncommon::domainlogo($domain); |
|
my $showadminmail=&Apache::loncommon::designparm('login.adminmail', $domain); |
|
my $showcoursecat = |
|
&Apache::loncommon::designparm('login.coursecatalog',$domain); |
|
|
|
|
# ----------------------------------------------------------------------- Texts |
# ----------------------------------------------------------------------- Texts |
|
|
Line 224 my %lt=&Apache::lonlocal::texthash(
|
Line 291 my %lt=&Apache::lonlocal::texthash(
|
'pw' => 'Password', |
'pw' => 'Password', |
'dom' => 'Domain', |
'dom' => 'Domain', |
'perc' => 'percent', |
'perc' => 'percent', |
'user' => 'User', |
'load' => 'Load', |
'load' => 'load', |
'userload' => 'User Load', |
|
'about' => 'About LON-CAPA', |
|
'access' => 'Accessibility Options', |
|
'catalog' => 'Course Catalog', |
|
'auth' => 'userauthentication.gif', |
'log' => 'Log in', |
'log' => 'Log in', |
'help' => 'Help', |
'help' => 'Log-in Help', |
'serv' => 'Server', |
'serv' => 'Server', |
'servadm' => 'Server Administration', |
'servadm' => 'Server Administration', |
'sysadm' => 'System Administration'); |
'helpdesk' => 'Contact Helpdesk', |
|
'forgotpw' => 'Forgot password?'); |
|
# -------------------------------------------------- Change password field name |
|
my $now=time; |
|
my $forgotpw = &forgotpwdisplay(%lt); |
|
my $loginhelp = &loginhelpdisplay(%lt); |
# ---------------------------------------------------------- Serve rest of page |
# ---------------------------------------------------------- Serve rest of page |
$r->print(<<ENDSCRIPT); |
$r->print(<<ENDSCRIPT); |
|
|
Line 270 my %lt=&Apache::lonlocal::texthash(
|
Line 344 my %lt=&Apache::lonlocal::texthash(
|
lextkey=this.document.client.elements.lextkey.value; |
lextkey=this.document.client.elements.lextkey.value; |
initkeys(); |
initkeys(); |
|
|
this.document.server.elements.upass.value |
this.document.server.elements.upass0.value |
=crypted(this.document.client.elements.upass.value); |
=crypted(this.document.client.elements.upass$now.value.substr(0,15)); |
|
this.document.server.elements.upass1.value |
|
=crypted(this.document.client.elements.upass$now.value.substr(15,15)); |
|
this.document.server.elements.upass2.value |
|
=crypted(this.document.client.elements.upass$now.value.substr(30,15)); |
|
|
|
this.document.client.elements.uname.value=''; |
|
this.document.client.elements.upass$now.value=''; |
|
|
this.document.server.submit(); |
this.document.server.submit(); |
return false; |
return false; |
Line 288 ENDSCRIPT
|
Line 369 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="upass0" value="" /> |
|
<input type="hidden" name="upass1" value="" /> |
|
<input type="hidden" name="upass2" value="" /> |
<input type="hidden" name="udom" value="" /> |
<input type="hidden" name="udom" value="" /> |
<input type="hidden" name="imagesuppress" value="" /> |
<input type="hidden" name="imagesuppress" value="" /> |
<input type="hidden" name="appletsuppress" value="" /> |
<input type="hidden" name="appletsuppress" value="" /> |
Line 298 ENDSCRIPT
|
Line 381 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 |
|
my $coursecatalog; |
|
if (($showcoursecat eq '') || ($showcoursecat)) { |
|
$coursecatalog = &coursecatalog_link($lt{'catalog'}); |
|
} |
if ($fullgraph) { $r->print(<<ENDTOP); |
if ($fullgraph) { $r->print(<<ENDTOP); |
<!-- The LON-CAPA Header --> |
<!-- The LON-CAPA Header --> |
<tr> |
<tr> |
Line 327 ENDSERVERFORM
|
Line 414 ENDSERVERFORM
|
</tr> |
</tr> |
<tr> |
<tr> |
|
|
<!-- A cell that will hold the 'access' and 'about' buttons --> |
<!-- A cell that will hold the 'access', 'about', and 'catalog' links --> |
<!-- Row 3 Column 1 --> |
<!-- Row 3 Column 1 --> |
<td valign="top" height=60 align="center" bgcolor="$sidebg"> |
<td valign="top" height="60" align="left" bgcolor="$sidebg"> |
<a href="/adm/login?interface=textual"><img src="$iconpath/accessbutton.gif" border=0 alt="Accessibility Options" /></a> |
<table cellpadding="0" cellspacing="2" border="0"> |
<br /> |
<tr> |
<a href="/adm/about.html"><img src="$iconpath/aboutlon.gif" border=0 alt="About LON-CAPA" /></a> |
<td> </td> |
|
<td><a href="/adm/login?interface=textual"><b>$lt{'access'}</b></a></td> |
|
</tr> |
|
<tr> |
|
<td> </td> |
|
<td><a href="/adm/about.html"><b>$lt{'about'}</b></a></td> |
|
</tr>$coursecatalog |
|
<tr> |
|
<td colspan="2"> </td> |
|
</tr> |
|
</table> |
</td> |
</td> |
|
|
<!-- The shaded space between the two main columns --> |
<!-- The shaded space between the two main columns --> |
<!-- Row 3 Column 2 --> |
<!-- Row 3 Column 2 --> |
<td width=27 height=60 background="$iconpath/fillleft.gif"><img src="$iconpath/fillleft.gif" alt="" /></td> |
<td width=27 height=60 background="$iconpath/fillleft.gif"><img src="$iconpath/fillleft.gif" alt="" /></td> |
Line 363 ENDTOP
|
Line 459 ENDTOP
|
unless ($fullgraph) { |
unless ($fullgraph) { |
$r->print(<<ENDACCESSOPTIONS); |
$r->print(<<ENDACCESSOPTIONS); |
<h3>Select Accessibility Options</h3> |
<h3>Select Accessibility Options</h3> |
<input type="checkbox" name="imagesuppress" /> Suppress rendering of images<br /> |
<label><input type="checkbox" name="imagesuppress" /> Suppress rendering of images</label><br /> |
<input type="checkbox" name="appletsuppress" /> Suppress Java applets<br /> |
<label><input type="checkbox" name="appletsuppress" /> Suppress Java applets</label><br /> |
<input type="checkbox" name="embedsuppress" /> Suppress rendering of embedded multimedia<br /> |
<label><input type="checkbox" name="embedsuppress" /> Suppress rendering of embedded multimedia</label><br /> |
<input type="checkbox" name="fontenhance" /> Increase font size<br /> |
<label><input type="checkbox" name="fontenhance" /> Increase font size</label><br /> |
<input type="checkbox" name="blackwhite" /> Switch to black and white mode<br /> |
<label><input type="checkbox" name="blackwhite" /> Switch to black and white mode</label><br /> |
<p>If you have accessibility needs that are not addressed by this interface, |
|
please |
|
contact the system administrator at <tt>$sysadm</tt>.</p><br /> |
|
<input type="checkbox" name="remember" /> Remember these settings for next login<hr /> |
<input type="checkbox" name="remember" /> Remember these settings for next login<hr /> |
ENDACCESSOPTIONS |
ENDACCESSOPTIONS |
} else { |
} else { |
Line 389 ENDNOOPT
|
Line 482 ENDNOOPT
|
|
|
<!-- Start the sub-table for text and input alignment --> |
<!-- Start the sub-table for text and input alignment --> |
<table border=0 cellspacing=0 cellpadding=0> |
<table border=0 cellspacing=0 cellpadding=0> |
<tr><td bgcolor="$sidebg" colspan=2><img src="$iconpath/userauthentication.gif" alt="User Authentication" /></td></tr> |
<tr><td bgcolor="$sidebg" colspan=2><img src="$iconpath/$lt{'auth'}" alt="User Authentication" /></td></tr> |
<tr> |
<tr> |
<td bgcolor="$mainbg"><br /><font size=-1><b> $lt{'un'}:</b></font></td> |
<td bgcolor="$mainbg"><br /><font size=-1><b> <label for="uname">$lt{'un'}</label>:</b></font></td> |
<td bgcolor="$mainbg"><br /><input type="text" name="uname" size="10" value="$authusername" /></td> |
<td bgcolor="$mainbg"><br /><input type="text" name="uname" size="10" value="$authusername" /></td> |
</tr> |
</tr> |
<tr> |
<tr> |
<td bgcolor="$mainbg"><font size=-1><b> $lt{'pw'}:</b></font></td> |
<td bgcolor="$mainbg"><font size=-1><b> <label for="upass$now">$lt{'pw'}</label>:</b></font></td> |
<td bgcolor="$mainbg"><input type="password" name="upass" size="10" /></td> |
<td bgcolor="$mainbg"><input type="password" name="upass$now" size="10" /></td> |
</tr> |
</tr> |
<tr> |
<tr> |
<td bgcolor="$mainbg"><font size=-1><b> $lt{'dom'}:</b></font></td> |
<td bgcolor="$mainbg"><font size=-1><b> <label for="udom">$lt{'dom'}</label>:</b></font></td> |
<td bgcolor="$mainbg"><input type="text" name="udom" size="10" value="$authdomain" /></td> |
<td bgcolor="$mainbg"><input type="text" name="udom" size="10" value="$authdomain" /></td> |
</tr> |
</tr> |
<tr> |
<tr> |
<td bgcolor="$mainbg"> <a href="/adm/loginproblems.html">$lt{'help'}</a></td> |
<td bgcolor="$mainbg"> </td> |
<td bgcolor="$mainbg" valign="bottom" align="center"> |
<td bgcolor="$mainbg" valign="bottom" align="center"> |
<br /> |
<br /> |
<input type="submit" value="$lt{'log'}" /> |
<input type="submit" value="$lt{'log'}" /> |
</td> |
</td> |
</tr> |
</tr> |
|
<tr> |
|
<td bgcolor="$mainbg" valign="bottom" align="left" colspan="2"> |
|
$loginhelp |
|
$forgotpw |
|
</td> |
|
</tr> |
</table> |
</table> |
<!-- End sub-table --> |
<!-- End sub-table --> |
</form> |
</form> |
ENDLOGIN |
ENDLOGIN |
if ($fullgraph) { |
if ($fullgraph) { |
|
my $helpdeskscript; |
|
my $contactblock = &contactdisplay(\%lt,$servadm,$showadminmail, |
|
$version,$authdomain,\$helpdeskscript); |
$r->print(<<ENDDOCUMENT); |
$r->print(<<ENDDOCUMENT); |
</td> |
</td> |
|
|
Line 450 ENDLOGIN
|
Line 552 ENDLOGIN
|
</tr> |
</tr> |
<tr> |
<tr> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<small><b> Load: </b></small> |
<small><b> $lt{'load'}: </b></small> |
</td> |
</td> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<small><tt> $loadpercent $lt{'perc'}</tt></small> |
<small><tt> $loadpercent $lt{'perc'}</tt></small> |
Line 458 ENDLOGIN
|
Line 560 ENDLOGIN
|
</tr> |
</tr> |
<tr> |
<tr> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<small><b> $lt{'user'} $lt{'load'}: </b></small> |
<small><b> $lt{'userload'}: </b></small> |
</td> |
</td> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<small><tt> $userloadpercent $lt{'perc'}</tt></small> |
<small><tt> $userloadpercent $lt{'perc'}</tt></small> |
Line 466 ENDLOGIN
|
Line 568 ENDLOGIN
|
</tr> |
</tr> |
</table> |
</table> |
<br /> |
<br /> |
<small> |
$contactblock |
<b> $lt{'sysadm'}:</b><br /> |
|
<tt> $sysadm</tt><br /> |
|
<b> $lt{'servadm'}:</b><br /> |
|
<tt> $servadm</tt><br /> <br /> |
|
$version |
|
</small> |
|
</td> |
</td> |
|
|
<!-- Row 5 Column 2 --> |
<!-- Row 5 Column 2 --> |
Line 502 $domainlogo
|
Line 598 $domainlogo
|
</tr> |
</tr> |
</table> |
</table> |
|
|
<script> |
<script type="text/javascript"> |
// the if prevents the script error if the browser can't handle this |
// the if prevents the script error if the browser can not handle this |
if ( document.client.uname ) { document.client.uname.focus(); } |
if ( document.client.uname ) { document.client.uname.focus(); } |
</script> |
</script> |
|
$helpdeskscript |
|
|
ENDDOCUMENT |
ENDDOCUMENT |
} |
} |
$r->print('</body></html>'); |
$r->print('</body></html>'); |
return OK; |
return OK; |
} |
} |
|
|
|
sub contactdisplay { |
|
my ($lt,$servadm,$showadminmail,$version,$authdomain,$helpdeskscript) = @_; |
|
my $contactblock; |
|
my $showhelpdesk = 0; |
|
my $requestmail = $Apache::lonnet::perlvar{'lonSupportEMail'}; |
|
if ($requestmail =~ m/^[^\@]+\@[^\@]+$/) { |
|
$showhelpdesk = 1; |
|
} |
|
if ($servadm && $showadminmail) { |
|
$contactblock .= '<b> '.$$lt{'servadm'}.':</b><br />'. |
|
'<tt> '.$servadm.'</tt><br /> <br />'; |
|
} |
|
if ($showhelpdesk) { |
|
$contactblock .= '<b> <a href="javascript:helpdesk()"><font size="+1">'.$lt->{'helpdesk'}.'</font></a></b><br />'; |
|
my $thisurl = &escape('/adm/login'); |
|
$$helpdeskscript = <<"ENDSCRIPT"; |
|
<script type="text/javascript"> |
|
function helpdesk() { |
|
var codedom = document.client.udom.value; |
|
if (codedom == '') { |
|
codedom = "$authdomain"; |
|
} |
|
var querystr = "origurl=$thisurl&codedom="+codedom; |
|
document.location.href = "/adm/helpdesk?"+querystr; |
|
return; |
|
} |
|
</script> |
|
ENDSCRIPT |
|
} |
|
$contactblock .= <<"ENDBLOCK"; |
|
$version |
|
ENDBLOCK |
|
return $contactblock; |
|
} |
|
|
|
sub forgotpwdisplay { |
|
my (%lt) = @_; |
|
my $prompt_for_resetpw = 1; |
|
if ($prompt_for_resetpw) { |
|
return '<br /> <a href="/adm/resetpw">'.$lt{'forgotpw'}.'</a></b><br /><br />'; |
|
} |
|
return; |
|
} |
|
|
|
sub loginhelpdisplay { |
|
my (%lt) = @_; |
|
my $login_help = 1; |
|
if ($login_help) { |
|
return ' <a href="/adm/loginproblems.html">'.$lt{'help'}.'</a></b>'; |
|
} |
|
return; |
|
} |
|
|
|
sub coursecatalog_link { |
|
my ($linkname) = @_; |
|
return <<"END"; |
|
<tr> |
|
<td> </td> |
|
<td><a href="/adm/coursecatalog"><b>$linkname</b></a></td> |
|
</tr> |
|
END |
|
} |
|
|
1; |
1; |
__END__ |
__END__ |