version 1.91, 2007/04/06 22:06:02
|
version 1.109, 2008/12/01 15:03:43
|
Line 30 package Apache::lonlogin;
|
Line 30 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(); |
Line 48 sub handler {
|
Line 47 sub handler {
|
$ENV{'REDIRECT_QUERY_STRING'}), |
$ENV{'REDIRECT_QUERY_STRING'}), |
['interface','username','domain','firsturl','localpath','localres', |
['interface','username','domain','firsturl','localpath','localres', |
'token']); |
'token']); |
|
if (!defined($env{'form.firsturl'})) { |
|
&Apache::lonacc::get_posted_cgi($r,['firsturl']); |
|
} |
|
|
# -- check if they are a migrating user |
# -- check if they are a migrating user |
if (defined($env{'form.token'})) { |
if (defined($env{'form.token'})) { |
Line 69 sub handler {
|
Line 71 sub handler {
|
|
|
|
|
# -------------------------------- Prevent users from attempting to login twice |
# -------------------------------- Prevent users from attempting to login twice |
my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); |
my $handle = &Apache::lonnet::check_for_valid_session($r); |
my $lonid=$cookies{'lonID'}; |
if ($handle=~/^publicuser\_/) { |
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 |
# For "public user" - remove it, we apparently really want to login |
unlink("$lonidsdir/$handle.id"); |
unlink($r->dir_config('lonIDsDir')."/$handle.id"); |
} elsif ($handle ne '') { |
} elsif ($handle ne '') { |
# Indeed, a valid token is found |
# Indeed, a valid token is found |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Already logged in'); |
&Apache::loncommon::start_page('Already logged in'); |
my $end_page = |
my $end_page = |
&Apache::loncommon::end_page(); |
&Apache::loncommon::end_page(); |
$r->print(<<ENDFAILED); |
$r->print( |
$start_page |
$start_page |
<h1>You are already logged in</h1> |
.'<h1>'.&mt('You are already logged in!').'</h1>' |
<p>Please either <a href="/adm/roles">continue the current session</a> or |
.'<p>'.&mt('Please either [_1]continue the current session[_2] or [_3]logout[_4].', |
<a href="/adm/logout">logout</a>.</p> |
'<a href="/adm/roles">','</a>','<a href="/adm/logout">','</a>').'</p>' |
<p> |
.'<p><a href="/adm/loginproblems.html">'.&mt('Login problems?').'</a></p>' |
<a href="/adm/loginproblems.html">Problems?</a></p> |
.$end_page |
$end_page |
); |
ENDFAILED |
return OK; |
return OK; |
|
} |
|
} |
|
} |
} |
|
|
# ---------------------------------------------------- No valid token, continue |
# ---------------------------------------------------- No valid token, continue |
Line 110 ENDFAILED
|
Line 102 ENDFAILED
|
# ----------------------------------------------------------- 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'); |
|
if (!defined($port_to_use)) { |
my $iconpath= |
$port_to_use='8080'; |
&Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL')); |
} |
|
my $iconpath= 'http://'.$ENV{'HTTP_HOST'}.':'.$port_to_use. |
|
$r->dir_config('lonIconsURL'); |
|
my $domain = &Apache::lonnet::default_login_domain(); |
my $domain = &Apache::lonnet::default_login_domain(); |
if (($env{'form.domain'}) && |
if (($env{'form.domain'}) && |
(&Apache::lonnet::domain($env{'form.domain'},'description'))) { |
(&Apache::lonnet::domain($env{'form.domain'},'description'))) { |
Line 160 ENDFAILED
|
Line 150 ENDFAILED
|
my $otherserver= &Apache::lonnet::absolute_url($host_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 overloaded? |
if (($role eq 'access') && |
if ((($userloadpercent>100.0)||($loadpercent>100.0))) { |
(($userloadpercent>100.0)||($loadpercent>100.0))) { |
|
my $unloaded=Apache::lonnet::spareserver($loadpercent,$userloadpercent); |
my $unloaded=Apache::lonnet::spareserver($loadpercent,$userloadpercent); |
if ($unloaded) { $otherserver=$unloaded; } |
if ($unloaded) { $otherserver=$unloaded; } |
} |
} |
Line 212 ENDFAILED
|
Line 201 ENDFAILED
|
$hostname. |
$hostname. |
'/adm/login?domain='.$authdomain.'">'. |
'/adm/login?domain='.$authdomain.'">'. |
$hostname.'</a>'. |
$hostname.'</a>'. |
' (preferred)</font>'.$/; |
' '.&mt('(preferred)').'</font>'.$/; |
$last=$hostname; |
$last=$hostname; |
} |
} |
$spares.= '<br />'; |
$spares.= '<br />'; |
my %all_hostnames = &Apache::lonnet::all_hostnames(); |
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(%all_hostnames)) { |
keys(%all_hostnames)) { |
next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid}); |
next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid}); |
my $hostname = &Apache::lonnet::hostname($hostid); |
my $hostname = &Apache::lonnet::hostname($hostid); |
next if ($last eq $hostname); |
next if ($last eq $hostname); |
$spares.='<br /><a href="http://'. |
$spares.='<br /><a href="http://'. |
$hostname. |
$hostname. |
'/adm/login?domain='.$authdomain.'">'. |
'/adm/login?domain='.$authdomain.'">'. |
$hostname.'</a>'; |
$hostname.'</a>'; |
$last=$hostname; |
$last=$hostname; |
} |
} |
$r->print(<<ENDTROUBLE); |
$r->print( |
<html> |
'<html>' |
<head><title>The LearningOnline Network with CAPA</title></head> |
.'<head><title>' |
<body bgcolor="#FFFFFF"> |
.&mt('The LearningOnline Network with CAPA') |
<img src="/adm/lonKaputt/lonlogo_broken.gif" align="right" /> |
.'</title></head>' |
<h3>This LON-CAPA server is temporarily not available for login</h3> |
.'<body bgcolor="#FFFFFF">' |
<p>Please attempt to login to one of the following servers:</p>$spares |
.'<h1>'.&mt('The LearningOnline Network with CAPA').'</h1>' |
</body> |
.'<img src="/adm/lonKaputt/lonlogo_broken.gif" align="right" />' |
</html> |
.'<h3>'.&mt('This LON-CAPA server is temporarily not available for login.').'</h3>' |
ENDTROUBLE |
.'<p>'.&mt('Please attempt to login to one of the following servers:').'</p>' |
return OK; |
.$spares |
} |
.'</body>' |
|
.'</html>' |
|
); |
|
return OK; |
|
} |
|
|
# ----------------------------------------------- Apparently we are in business |
# ----------------------------------------------- Apparently we are in business |
$servadm=~s/\,/\<br \/\>/g; |
$servadm=~s/\,/\<br \/\>/g; |
|
|
# --------------------------------------------------- Print login screen header |
|
$r->print(<<ENDHEADER); |
|
<html> |
|
<head> |
|
<meta HTTP-EQUIV="Refresh" CONTENT="$expire; url=/adm/roles" /> |
|
<title>The LearningOnline Network with CAPA Login</title> |
|
</head> |
|
ENDHEADER |
|
# ---------------------------------------------------- Serve out DES JavaScript |
|
{ |
|
my $jsh=Apache::File->new($include."/londes.js"); |
|
$r->print(<$jsh>); |
|
} |
|
|
|
# ----------------------------------------------------------- Front page design |
# ----------------------------------------------------------- Front page design |
my $pgbg= |
my $pgbg= |
($fullgraph?&Apache::loncommon::designparm('login.pgbg',$domain):'#FFFFFF'); |
($fullgraph?&Apache::loncommon::designparm('login.pgbg',$domain):'#FFFFFF'); |
my $font= |
my $font= |
($fullgraph?&Apache::loncommon::designparm('login.font',$domain):'#000000'); |
($fullgraph?&Apache::loncommon::designparm('login.font',$domain):'#000000'); |
my $link= |
my $link= |
($fullgraph?&Apache::loncommon::designparm('login.link',$domain):'#0000FF'); |
($fullgraph?&Apache::loncommon::designparm('login.link',$domain):'#0000FF'); |
my $vlink= |
my $vlink= |
($fullgraph?&Apache::loncommon::designparm('login.vlink',$domain):'#0000FF'); |
($fullgraph?&Apache::loncommon::designparm('login.vlink',$domain):'#0000FF'); |
my $alink=&Apache::loncommon::designparm('login.alink',$domain); |
my $alink=&Apache::loncommon::designparm('login.alink',$domain); |
my $mainbg= |
my $mainbg= |
($fullgraph?&Apache::loncommon::designparm('login.mainbg',$domain):'#FFFFFF'); |
($fullgraph?&Apache::loncommon::designparm('login.mainbg',$domain):'#FFFFFF'); |
my $sidebg= |
my $sidebg= |
($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 $textcol = |
my $img=&Apache::loncommon::designparm('login.img',$domain); |
($fullgraph?&Apache::loncommon::designparm('login.textcol',$domain):'#000000'); |
my $domainlogo=&Apache::loncommon::domainlogo($domain); |
my $bgcol = |
my $showadminmail=&Apache::loncommon::designparm('login.adminmail', $domain); |
($fullgraph?&Apache::loncommon::designparm('login.bgcol',$domain):'#FFFFFF'); |
my $showcoursecat = |
my $logo=&Apache::loncommon::designparm('login.logo',$domain); |
&Apache::loncommon::designparm('login.coursecatalog',$domain); |
my $img=&Apache::loncommon::designparm('login.img',$domain); |
|
my $domainlogo=&Apache::loncommon::domainlogo($domain); |
|
my $login=&Apache::loncommon::designparm('login.login',$domain); |
# ----------------------------------------------------------------------- Texts |
if ($login eq '') { |
|
$login = $iconpath.'/'.&mt('userauthentication.gif'); |
my %lt=&Apache::lonlocal::texthash( |
} |
'un' => 'Username', |
my $showbanner = 1; |
'pw' => 'Password', |
my $showmainlogo = 1; |
'dom' => 'Domain', |
if (defined(&Apache::loncommon::designparm('login.showlogo_img',$domain))) { |
'perc' => 'percent', |
$showbanner = &Apache::loncommon::designparm('login.showlogo_img',$domain); |
'load' => 'Load', |
} |
'userload' => 'User Load', |
if (defined(&Apache::loncommon::designparm('login.showlogo_logo',$domain))) { |
'about' => 'About LON-CAPA', |
$showmainlogo = &Apache::loncommon::designparm('login.showlogo_logo',$domain); |
'access' => 'Accessibility Options', |
} |
'catalog' => 'Course Catalog', |
my $showadminmail=&Apache::loncommon::designparm('login.adminmail',$domain); |
'auth' => 'userauthentication.gif', |
my $showcoursecat = |
'log' => 'Log in', |
&Apache::loncommon::designparm('login.coursecatalog',$domain); |
'help' => 'Log-in Help', |
my $loginheader =&Apache::loncommon::designparm('login.loginheader',$domain); |
'serv' => 'Server', |
my $shownewuserlink = |
'servadm' => 'Server Administration', |
&Apache::loncommon::designparm('login.newuser',$domain); |
'helpdesk' => 'Contact Helpdesk', |
my $now=time; |
'forgotpw' => 'Forgot password?'); |
my $js = (<<ENDSCRIPT); |
# -------------------------------------------------- Change password field name |
|
my $now=time; |
<script language="JavaScript"> |
my $forgotpw = &forgotpwdisplay(%lt); |
function send() |
my $loginhelp = &loginhelpdisplay(%lt); |
{ |
# ---------------------------------------------------------- Serve rest of page |
this.document.server.elements.uname.value |
$r->print(<<ENDSCRIPT); |
=this.document.client.elements.uname.value; |
|
|
<body bgcolor="$pgbg" text="$font" link="$link" vlink="$vlink" alink="$alink" |
this.document.server.elements.udom.value |
topmargin=0 leftmargin=0 marginwidth=0 marginheight=0> |
=this.document.client.elements.udom.value; |
|
|
<script language="JavaScript"> |
uextkey=this.document.client.elements.uextkey.value; |
function send() |
lextkey=this.document.client.elements.lextkey.value; |
{ |
initkeys(); |
this.document.server.elements.uname.value |
|
=this.document.client.elements.uname.value; |
this.document.server.elements.upass0.value |
|
=crypted(this.document.client.elements.upass$now.value.substr(0,15)); |
this.document.server.elements.udom.value |
this.document.server.elements.upass1.value |
=this.document.client.elements.udom.value; |
=crypted(this.document.client.elements.upass$now.value.substr(15,15)); |
|
this.document.server.elements.upass2.value |
this.document.server.elements.imagesuppress.value |
=crypted(this.document.client.elements.upass$now.value.substr(30,15)); |
=this.document.client.elements.imagesuppress.checked; |
|
|
|
this.document.server.elements.embedsuppress.value |
|
=this.document.client.elements.embedsuppress.checked; |
|
|
|
this.document.server.elements.appletsuppress.value |
this.document.client.elements.uname.value=''; |
=this.document.client.elements.appletsuppress.checked; |
this.document.client.elements.upass$now.value=''; |
|
|
this.document.server.elements.fontenhance.value |
this.document.server.submit(); |
=this.document.client.elements.fontenhance.checked; |
return false; |
|
} |
|
</script> |
|
|
this.document.server.elements.blackwhite.value |
ENDSCRIPT |
=this.document.client.elements.blackwhite.checked; |
|
|
|
this.document.server.elements.remember.value |
# --------------------------------------------------- Print login screen header |
=this.document.client.elements.remember.checked; |
|
|
|
uextkey=this.document.client.elements.uextkey.value; |
my %add_entries = (topmargin => "0", |
lextkey=this.document.client.elements.lextkey.value; |
leftmargin => "0", |
initkeys(); |
marginheight => "0", |
|
marginwidth => "0", |
|
bgcolor => "$mainbg", |
|
text => "$font", |
|
link => "$link", |
|
vlink => "$vlink", |
|
alink => "$alink",); |
|
|
|
$r->print(&Apache::loncommon::start_page('The LearningOnline Network with CAPA Login',$js, |
|
{ 'redirect' => [$expire,'/adm/roles'], |
|
'add_entries' => \%add_entries, |
|
'only_body' => 1,})); |
|
|
this.document.server.elements.upass0.value |
# ----------------------------------------------------------------------- Texts |
=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=''; |
my %lt=&Apache::lonlocal::texthash( |
this.document.client.elements.upass$now.value=''; |
'un' => 'Username', |
|
'pw' => 'Password', |
|
'dom' => 'Domain', |
|
'perc' => 'percent', |
|
'load' => 'Server Load', |
|
'userload' => 'User Load', |
|
'about' => 'About LON-CAPA', |
|
'catalog' => 'Course Catalog', |
|
'log' => 'Log in', |
|
'help' => 'Log-in Help', |
|
'serv' => 'Server', |
|
'servadm' => 'Server Administration', |
|
'helpdesk' => 'Contact Helpdesk', |
|
'forgotpw' => 'Forgot password?', |
|
'newuser' => 'New User?', |
|
'options_headline' => 'Select Accessibility Options', |
|
'sprs_img' => 'Suppress rendering of images', |
|
'sprs_applet' => 'Suppress Java applets', |
|
'sprs_embed' => 'Suppress rendering of embedded multimedia', |
|
'sprs_font' => 'Increase font size', |
|
'sprs_blackwhite' => 'Switch to black and white mode', |
|
'remember' => 'Remember these settings for next login'); |
|
# -------------------------------------------------- Change password field name |
|
my $forgotpw = &forgotpwdisplay(%lt); |
|
my $loginhelp = &loginhelpdisplay(%lt); |
|
|
this.document.server.submit(); |
# ---------------------------------------------------- Serve out DES JavaScript |
return false; |
{ |
} |
my $jsh=Apache::File->new($include."/londes.js"); |
</script> |
$r->print(<$jsh>); |
ENDSCRIPT |
} |
|
# ---------------------------------------------------------- Serve rest of page |
|
|
if ($fullgraph) { |
if ($fullgraph) { |
$r->print( |
$r->print( |
'<table width="100%" cellpadding=0 cellspacing=0 border=0>'); |
'<div class="LC_loginpage_container">'); |
} |
} |
|
|
$r->print(<<ENDSERVERFORM); |
$r->print(<<ENDSERVERFORM); |
<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="uname" value="" /> |
<input type="hidden" name="uname" value="" /> |
<input type="hidden" name="upass0" value="" /> |
<input type="hidden" name="upass0" value="" /> |
<input type="hidden" name="upass1" value="" /> |
<input type="hidden" name="upass1" value="" /> |
<input type="hidden" name="upass2" 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="appletsuppress" value="" /> |
|
<input type="hidden" name="embedsuppress" value="" /> |
|
<input type="hidden" name="fontenhance" value="" /> |
|
<input type="hidden" name="blackwhite" 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; |
my $coursecatalog; |
if ($showcoursecat eq '' || $showcoursecat)) { |
if (($showcoursecat eq '') || ($showcoursecat)) { |
$coursecatalog = &coursecatalog_link($lt{'catalog'}); |
$coursecatalog = &coursecatalog_link($lt{'catalog'}); |
} |
} |
if ($fullgraph) { $r->print(<<ENDTOP); |
my $newuserlink; |
<!-- The LON-CAPA Header --> |
if ($shownewuserlink) { |
<tr> |
$newuserlink = &newuser_link($lt{'newuser'}); |
|
|
<!-- Row 1 Columns 2-4 --> |
|
<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> |
|
|
|
<!-- The gray bar that starts the two table frames --> |
|
<tr> |
|
|
|
<!-- Row 2 Column 1 --> |
|
<td width=182 height=27 bgcolor="$sidebg"> </td> |
|
|
|
<!-- Row 2 Column 2 --> |
|
<td width=27 height=27 align="left" background="$iconpath/filltop.gif"><img src="$iconpath/upperleft.gif" border=0 alt="" /></td> |
|
|
|
<!-- Row 2 Column 3 --> |
|
<td height=27 background="$iconpath/filltop.gif"><img src="$iconpath/filltop.gif" alt="" /></td> |
|
|
|
<!-- Row 2 Column 4 --> |
|
<td width=27 height=27 align="right" background="$iconpath/filltop.gif"><img src="$iconpath/upperright.gif" border=0 alt="" /></td> |
|
</tr> |
|
<tr> |
|
|
|
<!-- A cell that will hold the 'access', 'about', and 'catalog' links --> |
|
<!-- Row 3 Column 1 --> |
|
<td valign="top" height="60" align="left" bgcolor="$sidebg"> |
|
<table cellpadding="0" cellspacing="2" border="0"> |
|
<tr> |
|
<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> |
|
<!-- The shaded space between the two main columns --> |
|
<!-- Row 3 Column 2 --> |
|
<td width=27 height=60 background="$iconpath/fillleft.gif"><img src="$iconpath/fillleft.gif" alt="" /></td> |
|
|
|
<!-- The right main column holding the large LON-CAPA logo--> |
|
<!-- Rows 3-4 Column 3 --> |
|
<td align="center" valign="top" width="100%" height="100%" bgcolor="$mainbg"> |
|
<center> |
|
<img src="$logo" alt="" /> |
|
</center> |
|
</td> |
|
|
|
<!-- Row 3 Column 4 --> |
|
<td width=27 background="$iconpath/fillright.gif"><img src="$iconpath/fillright.gif" alt="" /></td> |
|
</tr> |
|
<tr> |
|
|
|
<!-- The entry form --> |
|
<!-- Row 4 Column 1 --> |
|
<td align="center" valign="middle" bgcolor="$sidebg"> |
|
ENDTOP |
|
} else { |
|
$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())">'); |
my $logintitle; |
unless ($fullgraph) { |
if ($loginheader eq 'text') { |
$r->print(<<ENDACCESSOPTIONS); |
$logintitle = $lt{'log'}; |
<h3>Select Accessibility Options</h3> |
|
<label><input type="checkbox" name="imagesuppress" /> Suppress rendering of images</label><br /> |
|
<label><input type="checkbox" name="appletsuppress" /> Suppress Java applets</label><br /> |
|
<label><input type="checkbox" name="embedsuppress" /> Suppress rendering of embedded multimedia</label><br /> |
|
<label><input type="checkbox" name="fontenhance" /> Increase font size</label><br /> |
|
<label><input type="checkbox" name="blackwhite" /> Switch to black and white mode</label><br /> |
|
<input type="checkbox" name="remember" /> Remember these settings for next login<hr /> |
|
ENDACCESSOPTIONS |
|
} else { |
} else { |
$r->print(<<ENDNOOPT); |
$logintitle = '<img src="'.$login.'" alt="'. |
<input type="hidden" name="imagesuppress" value="" /> |
&mt('User Authentication').'" />'; |
<input type="hidden" name="embedsuppress" value="" /> |
} |
<input type="hidden" name="appletsuppress" value="" /> |
|
<input type="hidden" name="fontenhance" value="" /> |
|
<input type="hidden" name="blackwhite" value="" /> |
|
<input type="hidden" name="remember" value="" /> |
|
ENDNOOPT |
|
} |
|
$r->print(<<ENDLOGIN); |
|
<input type="hidden" name="lextkey" value="$lextkey"> |
|
<input type="hidden" name="uextkey" value="$uextkey"> |
|
|
|
<!-- Start the sub-table for text and input alignment --> |
my $noscript_warning='<noscript><span class="LC_warning"><b>' |
<table border=0 cellspacing=0 cellpadding=0> |
.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.') |
<tr><td bgcolor="$sidebg" colspan=2><img src="$iconpath/$lt{'auth'}" alt="User Authentication" /></td></tr> |
.'</b></span></noscript>'; |
|
my $helpdeskscript; |
|
my $contactblock = &contactdisplay(\%lt,$servadm,$showadminmail, |
|
$version,$authdomain,\$helpdeskscript); |
|
|
|
my $loginform=(<<LFORM); |
|
<form name="client" onsubmit="return(send())"> |
|
<input type="hidden" name="lextkey" value="$lextkey"> |
|
<input type="hidden" name="uextkey" value="$uextkey"> |
|
<b><label for="uname">$lt{'un'}</label>:</b><br /> |
|
<input type="text" name="uname" size="10" value="$authusername" /><br /> |
|
<b><label for="upass$now">$lt{'pw'}</label>:</b><br /> |
|
<input type="password" name="upass$now" size="10" /><br /> |
|
<b><label for="udom">$lt{'dom'}</label>:</b><br /> |
|
<input type="text" name="udom" size="10" value="$authdomain" /><br /> |
|
<input type="submit" value="$lt{'log'}" /> |
|
</form> |
|
LFORM |
|
|
|
if ($fullgraph) { |
|
if ($showbanner) { |
|
$r->print(<<HEADER); |
|
<!-- The LON-CAPA Header --> |
|
<table border="0" align="left" width="100%" cellspacing="0" cellpadding="1"> |
|
<tr> |
|
<td align="left" valign="top" bgcolor="$pgbg"> |
|
<img src="$img" border=0 alt="The Learning Online Network with CAPA" /> |
|
</td> |
|
</tr> |
|
</table> |
|
HEADER |
|
} |
|
if ($showmainlogo) { |
|
$r->print('<div class="LC_loginpage_space"> </div>'."\n". |
|
' <img src="'.$logo.'" alt="" />'."\n"); |
|
} |
|
$r->print(<<ENDTOP); |
|
<div class="LC_loginpage_loginContainer"> |
|
<fieldset class="LC_loginpage_fieldset"> |
|
<legend class="LC_loginpage_legend">$logintitle</legend> |
|
<table border="0" align="left" cellspacing="1" cellpadding="1" width="100%"> |
<tr> |
<tr> |
<td bgcolor="$mainbg"><br /><font size=-1><b> $lt{'un'}:</b></font></td> |
<td width="50%" align="center" valign="top"> |
<td bgcolor="$mainbg"><br /><input type="text" name="uname" size="10" value="$authusername" /></td> |
$domainlogo |
|
</td> |
|
<td> |
|
$loginform |
|
</td> |
</tr> |
</tr> |
<tr> |
</table> |
<td bgcolor="$mainbg"><font size=-1><b> $lt{'pw'}:</b></font></td> |
$noscript_warning |
<td bgcolor="$mainbg"><input type="password" name="upass$now" size="10" /></td> |
</fieldset> |
</tr> |
</div> |
<tr> |
|
<td bgcolor="$mainbg"><font size=-1><b> $lt{'dom'}:</b></font></td> |
<div class="LC_loginpage_loginInfo"> |
<td bgcolor="$mainbg"><input type="text" name="udom" size="10" value="$authdomain" /></td> |
$loginhelp<br /> |
</tr> |
$forgotpw<br /><br /> |
<tr> |
$newuserlink<br /> |
<td bgcolor="$mainbg"> </td> |
$coursecatalog<br /><br /> |
<td bgcolor="$mainbg" valign="bottom" align="center"> |
<a href="/adm/about.html"><b>$lt{'about'}</b></a><br /> |
<br /> |
$helpdeskscript |
<input type="submit" value="$lt{'log'}" /> |
</div> |
</td> |
|
</tr> |
<div class="LC_loginpage_space"> </div> |
<tr> |
$announcements |
<td bgcolor="$mainbg" valign="bottom" align="left" colspan="2"> |
ENDTOP |
$loginhelp |
} |
$forgotpw |
|
</td> |
if($announcements){$r->print('<div class="LC_loginpage_space"> </div>');} |
</tr> |
|
</table> |
if ($fullgraph) { |
<!-- End sub-table --> |
$r->print(<<ENDDOCUMENT); |
</form> |
|
ENDLOGIN |
|
if ($fullgraph) { |
|
my $helpdeskscript; |
|
my $contactblock = &contactdisplay(\%lt,$servadm,$showadminmail, |
|
$version,$authdomain,\$helpdeskscript); |
|
$r->print(<<ENDDOCUMENT); |
|
</td> |
|
|
|
<!-- Row 4 Column 2 --> |
|
<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 --> |
|
<td width=27 background="$iconpath/fillright.gif"><img src="$iconpath/fillright.gif" alt="" /></td> |
|
</tr> |
|
<tr> |
|
|
|
<!-- Row 5 Column 1 --> |
|
<td bgcolor="$sidebg" valign="middle" align="left"> |
|
<br /> |
|
<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"> |
Line 567 ENDLOGIN
|
Line 508 ENDLOGIN
|
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
<br /> |
|
$contactblock |
$contactblock |
</td> |
|
|
|
<!-- Row 5 Column 2 --> |
|
<td width=27 background="$iconpath/fillleft.gif"><img src="$iconpath/fillleft.gif" alt="" /></td> |
|
|
|
<!-- Row 5 Column 3 --> |
</div> |
<td width="100%" valign="bottom" bgcolor="$mainbg"> |
|
$domainlogo |
|
</td> |
|
|
|
<!-- Row 5 Column 4 --> |
|
<td width=27 background="$iconpath/fillright.gif"><img src="$iconpath/fillright.gif" alt="" /></td> |
|
</tr> |
|
<tr> |
|
|
|
<!-- Row 6 Column 1 --> |
|
<td bgcolor="$sidebg"> </td> |
|
|
|
<!-- Row 6 Column 2 --> |
|
<td align="left" background="$iconpath/fillbottom.gif"><img src="$iconpath/lowerleft.gif" alt="" /></td> |
|
|
|
<!-- Row 6 Column 3 --> |
|
<td background="$iconpath/fillbottom.gif"><img src="$iconpath/fillbottom.gif" alt="" /></td> |
|
|
|
<!-- Row 6 Column 4 --> |
|
<td align="right" background="$iconpath/fillbottom.gif"><img src="$iconpath/lowerright.gif" alt="" /></td> |
|
</tr> |
|
</table> |
|
|
|
<script type="text/javascript"> |
<script type="text/javascript"> |
// the if prevents the script error if the browser can not handle this |
// the if prevents the script error if the browser can not handle this |
Line 606 $helpdeskscript
|
Line 521 $helpdeskscript
|
|
|
ENDDOCUMENT |
ENDDOCUMENT |
} |
} |
$r->print('</body></html>'); |
my %endargs = ( 'noredirectlink' => 1, ); |
|
$r->print(&Apache::loncommon::end_page(\%endargs)); |
return OK; |
return OK; |
} |
} |
|
|
Line 649 sub forgotpwdisplay {
|
Line 565 sub forgotpwdisplay {
|
my (%lt) = @_; |
my (%lt) = @_; |
my $prompt_for_resetpw = 1; |
my $prompt_for_resetpw = 1; |
if ($prompt_for_resetpw) { |
if ($prompt_for_resetpw) { |
return '<br /> <a href="/adm/resetpw">'.$lt{'forgotpw'}.'</a></b><br /><br />'; |
return '<a href="/adm/resetpw">'.$lt{'forgotpw'}.'</a>'; |
} |
} |
return; |
return; |
} |
} |
Line 658 sub loginhelpdisplay {
|
Line 574 sub loginhelpdisplay {
|
my (%lt) = @_; |
my (%lt) = @_; |
my $login_help = 1; |
my $login_help = 1; |
if ($login_help) { |
if ($login_help) { |
return ' <a href="/adm/loginproblems.html">'.$lt{'help'}.'</a></b>'; |
return '<a href="/adm/loginproblems.html">'.$lt{'help'}.'</a>'; |
} |
} |
return; |
return; |
} |
} |
Line 666 sub loginhelpdisplay {
|
Line 582 sub loginhelpdisplay {
|
sub coursecatalog_link { |
sub coursecatalog_link { |
my ($linkname) = @_; |
my ($linkname) = @_; |
return <<"END"; |
return <<"END"; |
<tr> |
<a href="/adm/coursecatalog">$linkname</a> |
<td> </td> |
|
<td><a href="/adm/coursecatalog"><b>$linkname</b></a></td> |
|
</tr> |
|
END |
END |
} |
} |
|
|
|
sub newuser_link { |
|
my ($linkname) = @_; |
|
return ' <a href="/adm/createaccount"><b>'.$linkname.'</b></a><br />'; |
|
} |
|
|
1; |
1; |
__END__ |
__END__ |