version 1.65, 2005/06/07 02:14:28
|
version 1.76, 2006/07/24 17:25:48
|
Line 36 use Apache::lonnet;
|
Line 36 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; |
|
|
|
&Apache::loncommon::get_unprocessed_cgi |
|
($ENV{'QUERY_STRING'}.'&'.$env{'request.querystring'}, |
|
['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::lonlocal::get_language_handle($r); |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
Line 52 sub handler {
|
Line 67 sub handler {
|
return OK; |
return OK; |
} |
} |
|
|
|
|
# -------------------------------- Prevent users from attempting to login twice |
# -------------------------------- Prevent users from attempting to login twice |
my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); |
my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); |
my $lonid=$cookies{'lonID'}; |
my $lonid=$cookies{'lonID'}; |
Line 60 sub handler {
|
Line 76 sub handler {
|
my $handle=$lonid->value; |
my $handle=$lonid->value; |
$handle=~s/\W//g; |
$handle=~s/\W//g; |
my $lonidsdir=$r->dir_config('lonIDsDir'); |
my $lonidsdir=$r->dir_config('lonIDsDir'); |
if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) { |
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 |
# Indeed, a valid token is found |
my $bodytag=&Apache::loncommon::bodytag('Already logged in'); |
my $start_page = |
$r->print(<<ENDFAILED); |
&Apache::loncommon::start_page('Already logged in'); |
<html> |
my $end_page = |
<head> |
&Apache::loncommon::end_page(); |
<title>Already logged in</title> |
$r->print(<<ENDFAILED); |
</head> |
$start_page |
$bodytag |
|
<h1>You are already logged in</h1> |
<h1>You are already logged in</h1> |
<p>Please either <a href="/adm/roles">continue the current session</a> or |
<p>Please either <a href="/adm/roles">continue the current session</a> or |
<a href="/adm/logout">logout</a>.</p> |
<a href="/adm/logout">logout</a>.</p> |
<p> |
<p> |
<a href="/adm/loginproblems.html">Problems?</a></p> |
<a href="/adm/loginproblems.html">Problems?</a></p> |
</body> |
$end_page |
</html> |
|
ENDFAILED |
ENDFAILED |
return OK; |
return OK; |
|
} |
} |
} |
} |
} |
|
|
# ---------------------------------------------------- No valid token, continue |
# ---------------------------------------------------- No valid token, continue |
|
|
&Apache::loncommon::get_unprocessed_cgi |
# ---------------------------- Not possible to really login to domain "public" |
($ENV{'QUERY_STRING'}.'&'.$env{'request.querystring'}, |
if ($env{'form.domain'} eq 'public') { |
['interface','username','domain','firsturl','localpath','localres']); |
$env{'form.domain'}=''; |
|
$env{'form.username'}=''; |
|
} |
# ----------------------------------------------------------- Process Interface |
# ----------------------------------------------------------- Process Interface |
$env{'form.interface'}=~s/\W//g; |
$env{'form.interface'}=~s/\W//g; |
|
|
Line 108 ENDFAILED
|
Line 128 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'); |
|
my $testdomain=(split(/\./,$ENV{'HTTP_HOST'}))[0]; |
|
foreach my $posdom (&Apache::lonnet::current_machine_domains()) { |
|
if (lc($posdom) eq lc($testdomain)) { $domain=$posdom; } |
|
} |
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'}; |
Line 121 ENDFAILED
|
Line 145 ENDFAILED
|
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 |
|
|
Line 138 ENDFAILED
|
Line 163 ENDFAILED
|
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='http://'.$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? |
Line 279 my %lt=&Apache::lonlocal::texthash(
|
Line 304 my %lt=&Apache::lonlocal::texthash(
|
'servadm' => 'Server Administration', |
'servadm' => 'Server Administration', |
'sysadm' => 'System Administration', |
'sysadm' => 'System Administration', |
'helpdesk' => 'Contact Helpdesk'); |
'helpdesk' => 'Contact Helpdesk'); |
|
# -------------------------------------------------- Change password field name |
|
my $now=time; |
# ---------------------------------------------------------- Serve rest of page |
# ---------------------------------------------------------- Serve rest of page |
$r->print(<<ENDSCRIPT); |
$r->print(<<ENDSCRIPT); |
|
|
Line 318 my %lt=&Apache::lonlocal::texthash(
|
Line 344 my %lt=&Apache::lonlocal::texthash(
|
initkeys(); |
initkeys(); |
|
|
this.document.server.elements.upass0.value |
this.document.server.elements.upass0.value |
=crypted(this.document.client.elements.upass.value.substr(0,15)); |
=crypted(this.document.client.elements.upass$now.value.substr(0,15)); |
this.document.server.elements.upass1.value |
this.document.server.elements.upass1.value |
=crypted(this.document.client.elements.upass.value.substr(15,15)); |
=crypted(this.document.client.elements.upass$now.value.substr(15,15)); |
this.document.server.elements.upass2.value |
this.document.server.elements.upass2.value |
=crypted(this.document.client.elements.upass.value.substr(30,15)); |
=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 416 ENDTOP
|
Line 445 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, |
<p>If you have accessibility needs that are not addressed by this interface, |
please |
please |
contact the system administrator at <tt>$sysadm</tt>.</p><br /> |
contact the system administrator at <tt>$sysadm</tt>.</p><br /> |
Line 449 ENDNOOPT
|
Line 478 ENDNOOPT
|
</tr> |
</tr> |
<tr> |
<tr> |
<td bgcolor="$mainbg"><font size=-1><b> $lt{'pw'}:</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$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> $lt{'dom'}:</b></font></td> |
Line 583 sub contactdisplay {
|
Line 612 sub contactdisplay {
|
} |
} |
if ($showhelpdesk) { |
if ($showhelpdesk) { |
$contactblock .= '<b> <a href="javascript:helpdesk()">'.$$lt{'helpdesk'}.'</a></b><br />'; |
$contactblock .= '<b> <a href="javascript:helpdesk()">'.$$lt{'helpdesk'}.'</a></b><br />'; |
my $thisurl = &Apache::lonnet::escape('/adm/login'); |
my $thisurl = &escape('/adm/login'); |
$$helpdeskscript = <<"ENDSCRIPT"; |
$$helpdeskscript = <<"ENDSCRIPT"; |
<script type="text/javascript"> |
<script type="text/javascript"> |
function helpdesk() { |
function helpdesk() { |