Diff for /loncom/auth/switchserver.pm between versions 1.17 and 1.20

version 1.17, 2007/09/29 04:03:46 version 1.20, 2007/11/15 01:16:32
Line 42  sub init_env { Line 42  sub init_env {
  return  $env{'user.environment'};   return  $env{'user.environment'};
     }      }
     my $requrl=$r->uri;      my $requrl=$r->uri;
     my %cookies=CGI::Cookie->parse($r->header_in('Cookie'));      my $handle= &Apache::lonnet::check_for_valid_session($r);
     my $lonid=$cookies{'lonID'};      if ($handle ne '') {
     my $cookie;  
     if (!$lonid) { return undef; }  
   
     my $handle=&LONCAPA::clean_handle($lonid->value);  
     my $lonidsdir=$r->dir_config('lonIDsDir');  
     if ((!-e "$lonidsdir/$handle.id") || ($handle eq '')) {  
  $r->log_reason("Cookie $handle not valid", $r->filename);   
  return undef;   return undef;
     }      }
       my $lonidsdir=$r->dir_config('lonIDsDir');
     &Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle);      &Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle);
           
     return $r->dir_config('lonIDsDir')."/$handle.id";      return $r->dir_config('lonIDsDir')."/$handle.id";
Line 99  sub handler { Line 92  sub handler {
   
     if ($env{'user.name'} eq 'public'      if ($env{'user.name'} eq 'public'
  && $env{'user.domain'} eq 'public') {   && $env{'user.domain'} eq 'public') {
  my $url = 'http://'.$switch_to.'/'.$r->uri;   my $url = 'http://'.$switch_to.$r->uri;
  return &do_redirect($r,$url,1)   return &do_redirect($r,$url,1)
     }      }
   
Line 122  sub handler { Line 115  sub handler {
     -value   => '',      -value   => '',
     -expires => '-10y',);      -expires => '-10y',);
     $r->header_out('Set-cookie' => $c);      $r->header_out('Set-cookie' => $c);
     $r->send_http_header;  
     return OK if $r->header_only;      if ($r->header_only) {
    $r->send_http_header;
    return OK;
       }
 # -------------------------------------------------------- Menu script and info  # -------------------------------------------------------- Menu script and info
         
     my $windowinfo=      my $windowinfo=

Removed from v.1.17  
changed lines
  Added in v.1.20


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