Diff for /loncom/auth/lonlogin.pm between versions 1.55.2.2 and 1.59

version 1.55.2.2, 2005/04/28 01:25:08 version 1.59, 2004/11/02 23:20:17
Line 68  sub handler { Line 68  sub handler {
 <head>  <head>
 <title>Already logged in</title>  <title>Already logged in</title>
 </head>  </head>
 <html>  
 $bodytag  $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
Line 109  ENDFAILED Line 108  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 (values(%Apache::lonnet::hostdom)) {  
  if (lc($posdom) eq lc($testdomain)) { $domain=$testdomain; }  
     }  
     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 139  ENDFAILED Line 134  ENDFAILED
  $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
Line 184  ENDFAILED Line 179  ENDFAILED
   
     if ($logtoken eq 'con_lost') {      if ($logtoken eq 'con_lost') {
         my $spares='';          my $spares='';
         foreach (keys %Apache::lonnet::hostname) {  
             if ($_ ne $lonhost) {          foreach my $hostid (keys(%Apache::lonnet::spareid)) {
                $spares.='<br /><a href="http://'.$Apache::lonnet::hostname{$_}.              next if ($hostid eq $lonhost);
  '/adm/login?domain='.$authdomain.'">'.              $spares.='<br /><font size="+1"><a href="http://'.
                  $Apache::lonnet::hostname{$_}.'</a>';                  $Apache::lonnet::hostname{$hostid}.
                if ($Apache::lonnet::spareid{$_}) {                  '/adm/login?domain='.$authdomain.'">'.
    $spares.=' (preferred)';                  $Apache::lonnet::hostname{$hostid}.'</a>'.
                }                  ' (preferred)</font>'.$/;
    }          }
           $spares.= '<br />';
           foreach my $hostid (keys(%Apache::lonnet::hostname)) {
               next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid});
               $spares.='<br /><a href="http://'.
                   $Apache::lonnet::hostname{$hostid}.
                   '/adm/login?domain='.$authdomain.'">'.
                   $Apache::lonnet::hostname{$hostid}.'</a>';
         }          }
  $r->print(<<ENDTROUBLE);   $r->print(<<ENDTROUBLE);
 <html>  <html>
Line 533  $domainlogo Line 535  $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>
   

Removed from v.1.55.2.2  
changed lines
  Added in v.1.59


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>