Diff for /loncom/auth/lonauth.pm between versions 1.46 and 1.58

version 1.46, 2003/03/17 13:41:12 version 1.58, 2003/10/30 00:54:57
Line 46  use Apache::loncommon(); Line 46  use Apache::loncommon();
 use Apache::lonnet();  use Apache::lonnet();
 use Apache::lonmenu();  use Apache::lonmenu();
 use Fcntl qw(:flock);  use Fcntl qw(:flock);
   use Apache::lonlocal;
   
 my %FORM;  my %FORM;
   
Line 106  sub success { Line 107  sub success {
     if (($userenv{'interface'}) && (!$FORM{'interface'})) {      if (($userenv{'interface'}) && (!$FORM{'interface'})) {
  $FORM{'interface'}=$userenv{'interface'};   $FORM{'interface'}=$userenv{'interface'};
     }      }
       $ENV{'environment.remote'}=$userenv{'remote'};
   # --------------- Do not trust query string to be put directly into environment
       foreach ('imagesuppress','appletsuppress',
        'embedsuppress','fontenhance','blackwhite',
        'interface','localpath','localres') {
    $FORM{$_}=~s/[\n\r\=]//gs;
       }
 # --------------------------------------------------------- Write first profile  # --------------------------------------------------------- Write first profile
   
     {      {
Line 125  sub success { Line 133  sub success {
  print $idf "browser.mathml=$clientmathml\n";   print $idf "browser.mathml=$clientmathml\n";
  print $idf "browser.unicode=$clientunicode\n";   print $idf "browser.unicode=$clientunicode\n";
  print $idf "browser.os=$clientos\n";   print $idf "browser.os=$clientos\n";
           if ($FORM{'localpath'}) {
              print $idf "browser.localpath=$FORM{'localpath'}\n";
              print $idf "browser.localres=$FORM{'localres'}\n";
           }
  print $idf "request.course.fn=\n";   print $idf "request.course.fn=\n";
  print $idf "request.course.uri=\n";   print $idf "request.course.uri=\n";
  print $idf "request.course.sec=\n";   print $idf "request.course.sec=\n";
  print $idf "request.role=cm\n";   print $idf "request.role=cm\n";
           print $idf "request.role.adv=$ENV{'user.adv'}\n";
  print $idf "request.host=$ENV{'REMOTE_ADDR'}\n";   print $idf "request.host=$ENV{'REMOTE_ADDR'}\n";
  if ($FORM{'interface'}) {   if ($FORM{'interface'}) {
     $FORM{'interface'}=~s/\W//gs;      $FORM{'interface'}=~s/\W//gs;
Line 146  sub success { Line 159  sub success {
  $idf->close();   $idf->close();
     }      }
     $ENV{'request.role'}='cm';      $ENV{'request.role'}='cm';
       $ENV{'request.role.adv'}=$ENV{'user.adv'};
     $ENV{'browser.type'}=$clientbrowser;      $ENV{'browser.type'}=$clientbrowser;
 # -------------------------------------------------------------------- Log this  # -------------------------------------------------------------------- Log this
   
Line 177  Content-type: text/html Line 191  Content-type: text/html
 Set-cookie: $cookie  Set-cookie: $cookie
   
 ENDHEADER  ENDHEADER
       my %lt=&Apache::lonlocal::texthash(
          'wel' => 'Welcome',
          'mes' => 'Welcome to the Learning<i>Online</i> Network with CAPA. Please wait while your session is being set up',
          'pro' => 'Problems',
          'log' => 'loginproblems.html',
          );
     $r->print(<<ENDSUCCESS);      $r->print(<<ENDSUCCESS);
 <html>  <html>
 <head>  <head>
Line 186  $startupremote Line 206  $startupremote
 $bodytag  $bodytag
 $setflags  $setflags
 $windowinfo  $windowinfo
 <h1>Welcome!</h1>  <h1>$lt{'wel'}</h1>
 Welcome to the Learning<i>Online</i> Network with CAPA.  $lt{'mes'}.<p>
 Please wait while your session  <a href="/adm/$lt{'log'}">$lt{'pro'}?</a></p>
 is being set up.<p>  
 <a href="/adm/loginproblems.html">Problems?</a></p>  
 $maincall  $maincall
 </body>  </body>
 </html>  </html>
Line 223  $bodytag Line 241  $bodytag
 ENDFAILED  ENDFAILED
 }  }
   
   # ------------------------------------------------------------------ Rerouting!
   
   sub reroute {
       my $r=shift;
       my $bodytag=&Apache::loncommon::bodytag('Rerouting');
       $r->send_cgi_header(<<ENDRFHEADER);
   Content-type: text/html
   
   ENDRFHEADER
       $r->print(<<ENDRFAILED);
   <html>
   <head>
   <title>Rerouting Login to the LearningOnline Network with CAPA</title>
   </head>
   <html>
   $bodytag
   <h1>Sorry ...</h1>
   Please <a href="/">log in again</a>.
   </body>
   </html>
   ENDRFAILED
   }
   
 # ---------------------------------------------------------------- Main handler  # ---------------------------------------------------------------- Main handler
   
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
   
   # Are we re-routing?
       if (-e '/home/httpd/html/lon-status/reroute.txt') {
    &reroute($r);
    return OK;
       }
   
       &Apache::lonlocal::get_language_handle($r);
   
     my $buffer;      my $buffer;
     $r->read($buffer,$r->header_in('Content-length'));      $r->read($buffer,$r->header_in('Content-length'),0);
     my @pairs=split(/&/,$buffer);      my @pairs=split(/&/,$buffer);
     my $pair; my $name; my $value;      my $pair; my $name; my $value;
     undef %FORM;      undef %FORM;

Removed from v.1.46  
changed lines
  Added in v.1.58


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