Diff for /loncom/auth/lonlogin.pm between versions 1.73 and 1.81

version 1.73, 2006/02/28 16:44:19 version 1.81, 2006/09/28 00:59:02
Line 37  use Apache::loncommon(); Line 37  use Apache::loncommon();
 use Apache::lonauth();  use Apache::lonauth();
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::migrateuser();  use Apache::migrateuser();
   use lib '/home/httpd/lib/perl/';
   use LONCAPA;
    
   
   sub additional_machine_domains {
       my @domains;
       open(my $fh,"<".$Apache::lonnet::perlvar{'lonTabDir'}.'/expected_domains.tab');
       while( my $line = <$fh>) {
    $line =~ s/\s//g;
    push(@domains,$line);
       }
       return @domains;
   }
   
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
   
     &Apache::loncommon::get_unprocessed_cgi      &Apache::loncommon::get_unprocessed_cgi
  ($ENV{'QUERY_STRING'}.'&'.$env{'request.querystring'},   (join('&',$ENV{'QUERY_STRING'},$env{'request.querystring'},
         $ENV{'REDIRECT_QUERY_STRING'}),
  ['interface','username','domain','firsturl','localpath','localres',   ['interface','username','domain','firsturl','localpath','localres',
   'token']);    'token']);
   
Line 80  sub handler { Line 94  sub handler {
  unlink("$lonidsdir/$handle.id");   unlink("$lonidsdir/$handle.id");
     } elsif ($handle ne '') {      } 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 = 
       &Apache::loncommon::start_page('Already logged in');
    my $end_page = 
       &Apache::loncommon::end_page();
  $r->print(<<ENDFAILED);   $r->print(<<ENDFAILED);
 <html>  $start_page
 <head>  
 <title>Already logged in</title>  
 </head>  
 $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;
      }         }  
Line 128  ENDFAILED Line 140  ENDFAILED
                   $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];      my $testdomain=(split(/\./,$ENV{'HTTP_HOST'}))[0];
     foreach my $posdom (&Apache::lonnet::current_machine_domains()) {      foreach my $posdom (&Apache::lonnet::current_machine_domains(),
    &additional_machine_domains()) {
  if (lc($posdom) eq lc($testdomain)) { $domain=$posdom; }   if (lc($posdom) eq lc($testdomain)) { $domain=$posdom; }
     }      }
     if (($env{'form.domain'}) &&       if (($env{'form.domain'}) && 
Line 144  ENDFAILED Line 157  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 161  ENDFAILED Line 175  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= &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 access server and overloaded?
Line 610  sub contactdisplay { Line 624  sub contactdisplay {
     }      }
     if ($showhelpdesk) {      if ($showhelpdesk) {
         $contactblock .= '<b>&nbsp;&nbsp;&nbsp;<a href="javascript:helpdesk()">'.$$lt{'helpdesk'}.'</a></b><br />';          $contactblock .= '<b>&nbsp;&nbsp;&nbsp;<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() {

Removed from v.1.73  
changed lines
  Added in v.1.81


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