Diff for /loncom/auth/switchserver.pm between versions 1.35.2.6.2.2 and 1.35.2.6.2.3

version 1.35.2.6.2.2, 2022/07/08 15:52:52 version 1.35.2.6.2.3, 2022/08/30 16:20:17
Line 54  sub init_env { Line 54  sub init_env {
 }  }
   
 sub do_redirect {  sub do_redirect {
     my ($r,$url,$only_body,$extra_text) = @_;      my ($r,$url,$only_body,$extra_text,$write_to_opener) = @_;
     $r->send_http_header;      $r->send_http_header;
     my $delay = 0.5;      my $delay = 0.5;
     if ($only_body && !$extra_text) {      if ($only_body && !$extra_text) {
Line 62  sub do_redirect { Line 62  sub do_redirect {
     }      }
     my $start_page =       my $start_page = 
  &Apache::loncommon::start_page('Switching Server ...',undef,   &Apache::loncommon::start_page('Switching Server ...',undef,
        {'redirect'       => [$delay,$url],         {'redirect'       => [$delay,$url,'',$write_to_opener],
  'only_body'      => $only_body,});   'only_body'      => $only_body,});
     my $end_page   = &Apache::loncommon::end_page();      my $end_page   = &Apache::loncommon::end_page();
     $r->print($start_page.$extra_text.$end_page);      $r->print($start_page.$extra_text.$end_page);
Line 102  sub handler { Line 102  sub handler {
     if (!defined($handle)) { return FORBIDDEN; }      if (!defined($handle)) { return FORBIDDEN; }
   
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
  ['otherserver','role','origurl','symb']);   ['otherserver','role','origurl','symb','lcssowin']);
   
     my $switch_to=&Apache::lonnet::hostname($env{'form.otherserver'});      my $switch_to=&Apache::lonnet::hostname($env{'form.otherserver'});
     if (! $env{'form.otherserver'}) {      if (! $env{'form.otherserver'}) {
Line 270  sub handler { Line 270  sub handler {
     if ($env{'form.symb'}) {      if ($env{'form.symb'}) {
         $info{'symb'} = $env{'form.symb'};          $info{'symb'} = $env{'form.symb'};
     }      }
     my $ssologoutscript = '';       my $ssologoutscript = '';
       my $write_to_opener;
     if ($env{'request.sso.login'}) {      if ($env{'request.sso.login'}) {
  $info{'sso.login'} = $env{'request.sso.login'};   $info{'sso.login'} = $env{'request.sso.login'};
         if (defined($r->dir_config("lonSSOUserLogoutScriptFile_$info{domain}"))) {          if (defined($r->dir_config("lonSSOUserLogoutScriptFile_$info{domain}"))) {
Line 303  sub handler { Line 304  sub handler {
         $info{'deeplink.login'} = $env{'request.deeplink.login'};          $info{'deeplink.login'} = $env{'request.deeplink.login'};
     }      }
     my $token = &Apache::lonnet::tmpput(\%info,$env{'form.otherserver'});      my $token = &Apache::lonnet::tmpput(\%info,$env{'form.otherserver'});
     my $url =$protocol.'://'.$switch_to.'/adm/login?'.      my @args = ("domain=$env{'user.domain'}",
  'domain='.$env{'user.domain'}.                  "username=$env{'user.name'}",
  '&username='.$env{'user.name'}.                  "token=$token");
  '&token='.$token;      my $url = $protocol.'://'.$switch_to.'/adm/login?';
       if ($env{'form.lcssowin'}) {
           $url .= join('&',@args);
           $only_body = 1;
       } else {
           $url .= join('&',@args);
       }
 # --------------------------------------------------------------- Screen Output  # --------------------------------------------------------------- Screen Output
     return &do_redirect($r, $url, $only_body, $ssologoutscript);      return &do_redirect($r, $url, $only_body, $ssologoutscript, $env{'form.lcssowin'});
 }  }
   
 1;  1;

Removed from v.1.35.2.6.2.2  
changed lines
  Added in v.1.35.2.6.2.3


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