--- loncom/auth/switchserver.pm 2021/05/04 18:47:37 1.55 +++ loncom/auth/switchserver.pm 2021/10/26 14:20:40 1.59 @@ -1,7 +1,7 @@ # The LearningOnline Network # Switch Servers Handler # -# $Id: switchserver.pm,v 1.55 2021/05/04 18:47:37 raeburn Exp $ +# $Id: switchserver.pm,v 1.59 2021/10/26 14:20:40 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -57,7 +57,7 @@ sub do_redirect { my ($r,$url,$only_body,$extra_text) = @_; $r->send_http_header; my $delay = 0.5; - if ($only_body) { + if ($only_body && !$extra_text) { $delay = 0; } my $start_page = @@ -291,20 +291,32 @@ sub handler { if ($env{'form.symb'}) { $info{'symb'} = $env{'form.symb'}; } + my $ssologoutscript = ''; if ($env{'request.sso.login'}) { $info{'sso.login'} = $env{'request.sso.login'}; + if (defined($r->dir_config("lonSSOUserLogoutScriptFile_$info{domain}"))) { + if (open(my $fh,'<',$r->dir_config("lonSSOUserLogoutScriptFile_$info{domain}"))) { + $ssologoutscript .= join('',<$fh>); + close($fh); + } + } + if (defined($r->dir_config('lonSSOUserLogoutScriptFile'))) { + if (open(my $fh,'<',$r->dir_config('lonSSOUserLogoutScriptFile'))) { + $ssologoutscript .= join('',<$fh>); + close($fh); + } + } } if ($env{'request.sso.reloginserver'}) { $info{'sso.reloginserver'} = $env{'request.sso.reloginserver'}; } if ($env{'request.linkprot'}) { $info{'linkprot'} = $env{'request.linkprot'}; + } elsif ($env{'request.linkkey'} ne '') { + $info{'linkkey'} = $env{'request.linkkey'}; } if ($env{'request.deeplink.login'}) { $info{'deeplink.login'} = $env{'request.deeplink.login'}; - if ($env{'request.linkkey'}) { - $info{'linkkey'} = $env{'request.linkkey'}; - } } if ($env{'request.lti.login'}) { $info{'lti.login'} = $env{'request.lti.login'}; @@ -345,7 +357,7 @@ sub handler { '&username='.$env{'user.name'}. '&token='.$token; # --------------------------------------------------------------- Screen Output - return &do_redirect($r, $url, $only_body); + return &do_redirect($r, $url, $only_body, $ssologoutscript); } 1;