--- loncom/auth/lonlogin.pm 2010/08/25 17:47:21 1.141 +++ loncom/auth/lonlogin.pm 2011/03/03 06:37:30 1.147 @@ -1,7 +1,7 @@ # The LearningOnline Network # Login Screen # -# $Id: lonlogin.pm,v 1.141 2010/08/25 17:47:21 raeburn Exp $ +# $Id: lonlogin.pm,v 1.147 2011/03/03 06:37:30 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -69,6 +69,7 @@ sub handler { return OK; } + $env{'form.firsturl'} =~ s/(`)/'/g; # -------------------------------- Prevent users from attempting to login twice my $handle = &Apache::lonnet::check_for_valid_session($r); @@ -130,6 +131,7 @@ sub handler { } my $role = $r->dir_config('lonRole'); my $loadlim = $r->dir_config('lonLoadLim'); + my $uloadlim= $r->dir_config('lonUserLoadLim'); my $servadm = $r->dir_config('lonAdmEMail'); my $tabdir = $r->dir_config('lonTabDir'); my $include = $r->dir_config('lonIncludes'); @@ -149,8 +151,14 @@ sub handler { $loadavg=<$loadfile>; } $loadavg =~ s/\s.*//g; - my $loadpercent=sprintf("%.1f",100*$loadavg/$loadlim); - my $userloadpercent=&Apache::lonnet::userload(); + + my ($loadpercent,$userloadpercent); + if ($loadlim) { + $loadpercent=sprintf("%.1f",100*$loadavg/$loadlim); + } + if ($uloadlim) { + $userloadpercent=&Apache::lonnet::userload(); + } my $firsturl= ($env{'request.firsturl'}?$env{'request.firsturl'}:$env{'form.firsturl'}); @@ -308,9 +316,9 @@ return false; } function enableInput() { - this.document.client.elements.upass$now.removeAttribute("readonly"); - this.document.client.elements.uname.removeAttribute("readonly"); - this.document.client.elements.udom.removeAttribute("readonly"); + this.document.client.elements.upass$now.removeAttribute("readOnly"); + this.document.client.elements.uname.removeAttribute("readOnly"); + this.document.client.elements.udom.removeAttribute("readOnly"); return; } @@ -434,7 +442,7 @@ LFORM HEADER } $r->print(< +
$logintitle $loginform @@ -460,10 +468,8 @@ $announcements

ENDTOP - -$r->print(< - + my ($domainrow,$serverrow,$loadrow,$userloadrow,$versionrow); + $domainrow = <<"END"; +END + $serverrow = <<"END"; +END + if ($loadlim) { + $loadrow = <<"END"; +END + } + if ($uloadlim) { + $userloadrow = <<"END"; +END + } + if (($version ne '') && ($version ne '')) { + $versionrow = <<"END"; +END + } + +$r->print(< +
$lt{'dom'}:  @@ -472,6 +478,8 @@ $r->print(< $domain
$lt{'serv'}:  @@ -480,6 +488,9 @@ $r->print(< $lonhost ($role)
$lt{'load'}:  @@ -488,6 +499,10 @@ $r->print(< $loadpercent $lt{'perc'}
$lt{'userload'}:  @@ -496,11 +511,26 @@ $r->print(< $userloadpercent $lt{'perc'}
$version
+$domainrow +$serverrow +$loadrow +$userloadrow +$versionrow