Diff for /loncom/auth/lonlogin.pm between versions 1.147 and 1.148

version 1.147, 2011/03/03 06:37:30 version 1.148, 2011/06/11 18:21:07
Line 200  sub handler { Line 200  sub handler {
        'tmpput:'.$ukey.$lkey.'&'.$firsturl.$tokenextras,         'tmpput:'.$ukey.$lkey.'&'.$firsturl.$tokenextras,
        $lonhost);         $lonhost);
   
 # ------------------- If we cannot talk to ourselves, we are in serious trouble  # -- If we cannot talk to ourselves, or hostID does not map to a hostname
   #    we are in serious trouble
   
     if ($logtoken eq 'con_lost') {      if (($logtoken eq 'con_lost') || ($logtoken eq 'no_such_host')) {
           if ($logtoken eq 'no_such_host') {
               &Apache::lonnet::logthis('No valid logtoken for log-in page -- unable to determine hostname for hostID: '.$lonhost.'. Check entry in hosts.tab');
           }
         my $spares='';          my $spares='';
  my $last;   my $last;
         foreach my $hostid (sort          foreach my $hostid (sort
Line 213  sub handler { Line 217  sub handler {
     keys(%Apache::lonnet::spareid)) {      keys(%Apache::lonnet::spareid)) {
             next if ($hostid eq $lonhost);              next if ($hostid eq $lonhost);
     my $hostname = &Apache::lonnet::hostname($hostid);      my $hostname = &Apache::lonnet::hostname($hostid);
     next if ($last eq $hostname);      next if (($last eq $hostname) || ($hostname eq ''));
             $spares.='<br /><font size="+1"><a href="http://'.              $spares.='<br /><font size="+1"><a href="http://'.
                 $hostname.                  $hostname.
                 '/adm/login?domain='.$authdomain.'">'.                  '/adm/login?domain='.$authdomain.'">'.
Line 221  sub handler { Line 225  sub handler {
                 ' '.&mt('(preferred)').'</font>'.$/;                  ' '.&mt('(preferred)').'</font>'.$/;
     $last=$hostname;      $last=$hostname;
         }          }
 $spares.= '<br />';          if ($spares) {
               $spares.= '<br />';
           }
 my %all_hostnames = &Apache::lonnet::all_hostnames();  my %all_hostnames = &Apache::lonnet::all_hostnames();
 foreach my $hostid (sort  foreach my $hostid (sort
     {      {
Line 231  foreach my $hostid (sort Line 237  foreach my $hostid (sort
     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) || ($hostname eq ''));
     $spares.='<br /><a href="http://'.      $spares.='<br /><a href="http://'.
  $hostname.   $hostname.
  '/adm/login?domain='.$authdomain.'">'.   '/adm/login?domain='.$authdomain.'">'.
Line 246  $r->print( Line 252  $r->print(
   .'<body bgcolor="#FFFFFF">'    .'<body bgcolor="#FFFFFF">'
   .'<h1>'.&mt('The LearningOnline Network with CAPA').'</h1>'    .'<h1>'.&mt('The LearningOnline Network with CAPA').'</h1>'
   .'<img src="/adm/lonKaputt/lonlogo_broken.gif" align="right" />'    .'<img src="/adm/lonKaputt/lonlogo_broken.gif" align="right" />'
   .'<h3>'.&mt('This LON-CAPA server is temporarily not available for login.').'</h3>'    .'<h3>'.&mt('This LON-CAPA server is temporarily not available for login.').'</h3>');
   .'<p>'.&mt('Please attempt to login to one of the following servers:').'</p>'      if ($spares) {
   .$spares          $r->print('<p>'.&mt('Please attempt to login to one of the following servers:')
   .'</body>'                   .'</p>'
                    .$spares);
       }
       $r->print('</body>'
   .'</html>'    .'</html>'
 );      );
 return OK;  return OK;
 }  }
   

Removed from v.1.147  
changed lines
  Added in v.1.148


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