version 1.39, 2003/04/02 14:57:32
|
version 1.64, 2005/04/28 01:19:20
|
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::lonlocal; |
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
$r->content_type('text/html'); |
|
&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; |
|
|
|
|
|
# Are we re-routing? |
|
if (-e '/home/httpd/html/lon-status/reroute.txt') { |
|
&Apache::lonauth::reroute($r); |
|
return OK; |
|
} |
|
|
|
# -------------------------------- 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=$lonid->value; |
|
$handle=~s/\W//g; |
|
my $lonidsdir=$r->dir_config('lonIDsDir'); |
|
if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) { |
|
# Indeed, a valid token is found |
|
my $bodytag=&Apache::loncommon::bodytag('Already logged in'); |
|
$r->print(<<ENDFAILED); |
|
<html> |
|
<head> |
|
<title>Already logged in</title> |
|
</head> |
|
$bodytag |
|
<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> |
|
</body> |
|
</html> |
|
ENDFAILED |
|
return OK; |
|
} |
|
} |
|
|
|
# ---------------------------------------------------- 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']); |
['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 $iconpath= 'http://'.$ENV{'HTTP_HOST'}.':8080'. |
if (!defined($port_to_use)) { |
|
$port_to_use='8080'; |
|
} |
|
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'}) && |
|
($Apache::lonnet::domaindescription{$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'); |
Line 78 sub handler {
|
Line 120 sub handler {
|
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'); |
|
|
# --------------------------------------------- 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; |
{ |
{ |
my $loadfile=Apache::File->new('/proc/loadavg'); |
my $loadfile=Apache::File->new('/proc/loadavg'); |
$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(); |
|
|
# ------------------------------------------------------- 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'}); |
# ---------------------------------------- Are we access server and overloaded? |
# ---------------------------------------- Are we access server and overloaded? |
if (($role eq 'access') && ($loadpercent>100.0)) { |
if (($role eq 'access') && |
$otherserver=Apache::lonnet::spareserver($loadpercent); |
(($userloadpercent>100.0)||($loadpercent>100.0))) { |
|
my $unloaded=Apache::lonnet::spareserver($loadpercent,$userloadpercent); |
|
if ($unloaded) { $otherserver=$unloaded; } |
} |
} |
|
|
|
# ----------------------------------------------------------- Get announcements |
|
my $announcements=&Apache::lonnet::getannounce(); |
# -------------------------------------------------------- Set login parameters |
# -------------------------------------------------------- Set login parameters |
|
|
my @hexstr=('0','1','2','3','4','5','6','7', |
my @hexstr=('0','1','2','3','4','5','6','7', |
Line 131 sub handler {
|
Line 179 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); |
} |
next if ($last eq $Apache::lonnet::hostname{$hostid}); |
|
$spares.='<br /><font size="+1"><a href="http://'. |
|
$Apache::lonnet::hostname{$hostid}. |
|
'/adm/login?domain='.$authdomain.'">'. |
|
$Apache::lonnet::hostname{$hostid}.'</a>'. |
|
' (preferred)</font>'.$/; |
|
$last=$Apache::lonnet::hostname{$hostid}; |
|
} |
|
$spares.= '<br />'; |
|
foreach my $hostid (sort |
|
{ |
|
$Apache::lonnet::hostname{$a} cmp |
|
$Apache::lonnet::hostname{$b}; |
|
} |
|
keys(%Apache::lonnet::hostname)) { |
|
next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid}); |
|
next if ($last eq $Apache::lonnet::hostname{$hostid}); |
|
$spares.='<br /><a href="http://'. |
|
$Apache::lonnet::hostname{$hostid}. |
|
'/adm/login?domain='.$authdomain.'">'. |
|
$Apache::lonnet::hostname{$hostid}.'</a>'; |
|
$last=$Apache::lonnet::hostname{$hostid}; |
} |
} |
$r->print(<<ENDTROUBLE); |
$r->print(<<ENDTROUBLE); |
<html> |
<html> |
Line 157 ENDTROUBLE
|
Line 226 ENDTROUBLE
|
|
|
# ----------------------------------------------- Apparently we are in business |
# ----------------------------------------------- Apparently we are in business |
|
|
my $domainlogo=&Apache::loncommon::domainlogo(); |
my $domainlogo=&Apache::loncommon::domainlogo($domain); |
$servadm=~s/\,/\<br \/\>/g; |
$servadm=~s/\,/\<br \/\>/g; |
$sysadm=~s/\,/\<br \/\>/g; |
$sysadm=~s/\,/\<br \/\>/g; |
|
|
Line 177 ENDHEADER
|
Line 246 ENDHEADER
|
|
|
# ----------------------------------------------------------- Front page design |
# ----------------------------------------------------------- Front page design |
my $pgbg= |
my $pgbg= |
($fullgraph?&Apache::loncommon::designparm('login.pgbg'):'#FFFFFF'); |
($fullgraph?&Apache::loncommon::designparm('login.pgbg',$domain):'#FFFFFF'); |
my $font= |
my $font= |
($fullgraph?&Apache::loncommon::designparm('login.font'):'#000000'); |
($fullgraph?&Apache::loncommon::designparm('login.font',$domain):'#000000'); |
my $link= |
my $link= |
($fullgraph?&Apache::loncommon::designparm('login.link'):'#0000FF'); |
($fullgraph?&Apache::loncommon::designparm('login.link',$domain):'#0000FF'); |
my $vlink= |
my $vlink= |
($fullgraph?&Apache::loncommon::designparm('login.vlink'):'#0000FF'); |
($fullgraph?&Apache::loncommon::designparm('login.vlink',$domain):'#0000FF'); |
my $alink=&Apache::loncommon::designparm('login.alink'); |
my $alink=&Apache::loncommon::designparm('login.alink',$domain); |
my $mainbg= |
my $mainbg= |
($fullgraph?&Apache::loncommon::designparm('login.mainbg'):'#FFFFFF'); |
($fullgraph?&Apache::loncommon::designparm('login.mainbg',$domain):'#FFFFFF'); |
my $sidebg= |
my $sidebg= |
($fullgraph?&Apache::loncommon::designparm('login.sidebg'):'#FFFFFF'); |
($fullgraph?&Apache::loncommon::designparm('login.sidebg',$domain):'#FFFFFF'); |
my $logo=&Apache::loncommon::designparm('login.logo'); |
my $logo=&Apache::loncommon::designparm('login.logo',$domain); |
my $img=&Apache::loncommon::designparm('login.img'); |
my $img=&Apache::loncommon::designparm('login.img',$domain); |
|
|
|
# ----------------------------------------------------------------------- Texts |
|
|
|
my %lt=&Apache::lonlocal::texthash( |
|
'un' => 'Username', |
|
'pw' => 'Password', |
|
'dom' => 'Domain', |
|
'perc' => 'percent', |
|
'load' => 'Load', |
|
'userload' => 'User Load', |
|
'about' => 'aboutlon.gif', |
|
'access' => 'accessbutton.gif', |
|
'auth' => 'userauthentication.gif', |
|
'log' => 'Log in', |
|
'help' => 'Help', |
|
'serv' => 'Server', |
|
'servadm' => 'Server Administration', |
|
'sysadm' => 'System Administration', |
|
'helpdesk' => 'Contact Helpdesk'); |
|
|
# ---------------------------------------------------------- Serve rest of page |
# ---------------------------------------------------------- Serve rest of page |
$r->print(<<ENDSCRIPT); |
$r->print(<<ENDSCRIPT); |
Line 248 ENDSCRIPT
|
Line 335 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 258 ENDSCRIPT
|
Line 345 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="localres" value="$env{'form.localres'}" /> |
</form> |
</form> |
ENDSERVERFORM |
ENDSERVERFORM |
if ($fullgraph) { $r->print(<<ENDTOP); |
if ($fullgraph) { $r->print(<<ENDTOP); |
Line 288 ENDSERVERFORM
|
Line 377 ENDSERVERFORM
|
<!-- A cell that will hold the 'access' and 'about' buttons --> |
<!-- A cell that will hold the 'access' and 'about' buttons --> |
<!-- Row 3 Column 1 --> |
<!-- Row 3 Column 1 --> |
<td valign="top" height=60 align="center" bgcolor="$sidebg"> |
<td valign="top" height=60 align="center" bgcolor="$sidebg"> |
<a href="/adm/login?interface=textual"><img src="$iconpath/accessbutton.gif" border=0 alt="Accessibility Options" /></a> |
<a href="/adm/login?interface=textual"><img src="$iconpath/$lt{'access'}" border=0 alt="Accessibility Options" /></a> |
<br /> |
<br /> |
<a href="/adm/about.html"><img src="$iconpath/aboutlon.gif" border=0 alt="About LON-CAPA" /></a> |
<a href="/adm/about.html"><img src="$iconpath/$lt{'about'}" border=0 alt="About LON-CAPA" /></a> |
</td> |
</td> |
|
|
<!-- The shaded space between the two main columns --> |
<!-- The shaded space between the two main columns --> |
Line 299 ENDSERVERFORM
|
Line 388 ENDSERVERFORM
|
|
|
<!-- The right main column holding the large LON-CAPA logo--> |
<!-- The right main column holding the large LON-CAPA logo--> |
<!-- Rows 3-4 Column 3 --> |
<!-- Rows 3-4 Column 3 --> |
<td align="center" valign="top" width="100%" height="100%" rowspan=2 bgcolor="$mainbg"> |
<td align="center" valign="top" width="100%" height="100%" bgcolor="$mainbg"> |
<center> |
<center> |
<img src="$logo" alt="" /> |
<img src="$logo" alt="" /> |
</center> |
</center> |
Line 315 ENDSERVERFORM
|
Line 404 ENDSERVERFORM
|
<td align="center" valign="middle" bgcolor="$sidebg"> |
<td align="center" valign="middle" bgcolor="$sidebg"> |
ENDTOP |
ENDTOP |
} else { |
} else { |
$r->print('<h1>The Learning<i>Online</i> Network with CAPA</h1><h2>Text-based Interface Login</h2>'); |
$r->print('<h1>The Learning<i>Online</i> Network with CAPA</h1><h2>Text-based Interface Login</h2>'.$announcements); |
} |
} |
$r->print('<form name="client" onsubmit="return(send())">'); |
$r->print('<form name="client" onsubmit="return(send())">'); |
unless ($fullgraph) { |
unless ($fullgraph) { |
Line 347 ENDNOOPT
|
Line 436 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> User Name:</b></font></td> |
<td bgcolor="$mainbg"><br /><font size=-1><b> $lt{'un'}:</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> Password:</b></font></td> |
<td bgcolor="$mainbg"><font size=-1><b> $lt{'pw'}:</b></font></td> |
<td bgcolor="$mainbg"><input type="password" name="upass" size="10" /></td> |
<td bgcolor="$mainbg"><input type="password" name="upass" size="10" /></td> |
</tr> |
</tr> |
<tr> |
<tr> |
<td bgcolor="$mainbg"><font size=-1><b> Domain:</b></font></td> |
<td bgcolor="$mainbg"><font size=-1><b> $lt{'dom'}:</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">Help</a></td> |
<td bgcolor="$mainbg"> <a href="/adm/loginproblems.html">$lt{'help'}</a></td> |
<td bgcolor="$mainbg" valign="bottom" align="center"> |
<td bgcolor="$mainbg" valign="bottom" align="center"> |
<br /> |
<br /> |
<input type="submit" value="Log In" /> |
<input type="submit" value="$lt{'log'}" /> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 372 ENDNOOPT
|
Line 461 ENDNOOPT
|
</form> |
</form> |
ENDLOGIN |
ENDLOGIN |
if ($fullgraph) { |
if ($fullgraph) { |
|
my $helpdeskscript; |
|
my $contactblock = &contactdisplay(\%lt,$sysadm,$servadm,$version,$authdomain,\$helpdeskscript); |
$r->print(<<ENDDOCUMENT); |
$r->print(<<ENDDOCUMENT); |
</td> |
</td> |
|
|
<!-- Row 4 Column 2 --> |
<!-- Row 4 Column 2 --> |
<td width=27 background="$iconpath/fillleft.gif"><img src="$iconpath/fillleft.gif" alt="" /></td> |
<td width=27 background="$iconpath/fillleft.gif"><img src="$iconpath/fillleft.gif" alt="" /></td> |
|
|
|
<!-- Row 4 Column 3 --> |
|
<td bgcolor="$mainbg">$announcements</td> |
|
|
<!-- Row 4 Column 4 --> |
<!-- Row 4 Column 4 --> |
<td width=27 background="$iconpath/fillright.gif"><img src="$iconpath/fillright.gif" alt="" /></td> |
<td width=27 background="$iconpath/fillright.gif"><img src="$iconpath/fillright.gif" alt="" /></td> |
</tr> |
</tr> |
Line 389 ENDLOGIN
|
Line 483 ENDLOGIN
|
<table border=0 cellspacing=0 cellpadding=0> |
<table border=0 cellspacing=0 cellpadding=0> |
<tr> |
<tr> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<small><b> Domain: </b></small> |
<small><b> $lt{'dom'}: </b></small> |
</td> |
</td> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<small><tt> $domain</tt></small> |
<small><tt> $domain</tt></small> |
Line 397 ENDLOGIN
|
Line 491 ENDLOGIN
|
</tr> |
</tr> |
<tr> |
<tr> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<small><b> Server: </b></small> |
<small><b> $lt{'serv'}: </b></small> |
</td> |
</td> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<small><tt> $lonhost ($role)</tt></small> |
<small><tt> $lonhost ($role)</tt></small> |
Line 405 ENDLOGIN
|
Line 499 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 bgcolor="$sidebg" align="left" valign="top"> |
|
<small><tt> $loadpercent $lt{'perc'}</tt></small> |
|
</td> |
|
</tr> |
|
<tr> |
|
<td bgcolor="$sidebg" align="left" valign="top"> |
|
<small><b> $lt{'userload'}: </b></small> |
</td> |
</td> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<td bgcolor="$sidebg" align="left" valign="top"> |
<small><tt> $loadpercent percent</tt></small> |
<small><tt> $userloadpercent $lt{'perc'}</tt></small> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
<br /> |
<br /> |
<small> |
$contactblock |
<b> System Administration:</b><br /> |
|
<tt> $sysadm</tt><br /> |
|
<b> Server Administration:</b><br /> |
|
<tt> $servadm<br /> </tt> |
|
</small> |
|
</td> |
</td> |
|
|
<!-- Row 5 Column 2 --> |
<!-- Row 5 Column 2 --> |
Line 448 $domainlogo
|
Line 545 $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,$sysadm,$servadm,$version,$authdomain,$helpdeskscript) = @_; |
|
my $contactblock; |
|
my $showsysadm = 1; |
|
my $showservadm = 1; |
|
my $showhelpdesk = 0; |
|
my $requestmail = $Apache::lonnet::perlvar{'lonSupportEMail'}; |
|
if ($requestmail =~ m/^[^\@]+\@[^\@]+$/) { |
|
$showhelpdesk = 1; |
|
} |
|
if ($showsysadm) { |
|
$contactblock .= '<b> '.$$lt{'sysadm'}.':</b><br />'. |
|
'<tt> '.$sysadm.'</tt><br />'; |
|
} |
|
if ($showservadm) { |
|
$contactblock .= '<b> '.$$lt{'servadm'}.':</b><br />'. |
|
'<tt> '.$servadm.'</tt><br /> <br />'; |
|
} |
|
if ($showhelpdesk) { |
|
$contactblock .= '<b> <a href="javascript:helpdesk()">'.$$lt{'helpdesk'}.'</a></b><br />'; |
|
my $thisurl = &Apache::lonnet::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; |
|
} |
|
|
|
|
1; |
1; |
__END__ |
__END__ |