version 1.35.2.6.2.4, 2022/09/19 19:18:42
|
version 1.35.2.7, 2024/07/02 19:42:06
|
Line 54 sub init_env {
|
Line 54 sub init_env {
|
} |
} |
|
|
sub do_redirect { |
sub do_redirect { |
my ($r,$url,$only_body,$extra_text,$write_to_opener) = @_; |
my ($r,$url,$only_body,$extra_text) = @_; |
$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,'',$write_to_opener,1], |
{'redirect' => [$delay,$url,'',1], |
'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 97 sub flush_course_logs {
|
Line 97 sub flush_course_logs {
|
|
|
sub handler { |
sub handler { |
my ($r) = @_; |
my ($r) = @_; |
|
|
my $handle=&init_env($r); |
my $handle=&init_env($r); |
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','lcssowin','edit']); |
['otherserver','role','origurl','symb','edit']); |
|
|
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 308 sub handler {
|
Line 308 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 328 sub handler {
|
Line 327 sub handler {
|
if ($env{'request.sso.reloginserver'}) { |
if ($env{'request.sso.reloginserver'}) { |
$info{'sso.reloginserver'} = $env{'request.sso.reloginserver'}; |
$info{'sso.reloginserver'} = $env{'request.sso.reloginserver'}; |
} |
} |
if ($env{'request.linkprot'}) { |
|
$info{'linkprot'} = $env{'request.linkprot'}; |
|
foreach my $item ('linkprotuser','linkprotexit') { |
|
if ($env{'request.'.$item}) { |
|
$info{$item} = $env{'request.'.$item}; |
|
} |
|
} |
|
} elsif ($env{'request.linkkey'} ne '') { |
|
$info{'linkkey'} = $env{'request.linkkey'}; |
|
} |
|
if ($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 @args = ("domain=$env{'user.domain'}", |
my $url =$protocol.'://'.$switch_to.'/adm/login?'. |
"username=$env{'user.name'}", |
'domain='.$env{'user.domain'}. |
"token=$token"); |
'&username='.$env{'user.name'}. |
my $url = $protocol.'://'.$switch_to.'/adm/login?'; |
'&token='.$token; |
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, $env{'form.lcssowin'}); |
return &do_redirect($r, $url, $only_body, $ssologoutscript); |
} |
} |
|
|
1; |
1; |