version 1.35.2.6.2.5, 2023/01/23 01:59:24
|
version 1.35.2.6.2.8, 2024/10/09 15:49:17
|
Line 31 package Apache::switchserver;
|
Line 31 package Apache::switchserver;
|
use strict; |
use strict; |
use Apache::Constants qw(:common :remotehost); |
use Apache::Constants qw(:common :remotehost); |
use Apache::lonnet; |
use Apache::lonnet; |
|
use Apache::loncommon; |
|
use Apache::lonmenu; |
use Digest::MD5 qw(md5_hex); |
use Digest::MD5 qw(md5_hex); |
use CGI::Cookie(); |
use CGI::Cookie(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
Line 63 sub do_redirect {
|
Line 65 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,'',$write_to_opener,1], |
'only_body' => $only_body,}); |
'only_body' => $only_body, |
|
'switchserver' => 1, |
|
'links_disabled' => 1, |
|
'no_inline_link' => 1,}); |
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); |
unless ($env{'user.name'} eq 'public' && ($env{'user.domain'} eq 'public')) { |
unless ($env{'user.name'} eq 'public' && ($env{'user.domain'} eq 'public')) { |
Line 242 sub handler {
|
Line 247 sub handler {
|
my $logmsg = "Switch Server to $env{'form.otherserver'}"; |
my $logmsg = "Switch Server to $env{'form.otherserver'}"; |
if ($env{'form.role'}) { |
if ($env{'form.role'}) { |
$logmsg .= " with role: $env{'form.role'}"; |
$logmsg .= " with role: $env{'form.role'}"; |
|
} elsif (($env{'form.lti.reqcrs'}) && ($env{'form.lti.reqrole'} eq 'cc')) { |
|
$logmsg .= " to create new LTI course"; |
|
} elsif ($env{'form.lti.selfenrollrole'}) { |
|
$logmsg .= " to selfenroll with role: $env{'form.lti.selfenrollrole'}"; |
} else { |
} else { |
$logmsg .= " (no role)"; |
$logmsg .= " (no role)"; |
} |
} |
Line 267 sub handler {
|
Line 276 sub handler {
|
} |
} |
# -------------------------------------------------------- Menu script and info |
# -------------------------------------------------------- Menu script and info |
|
|
|
my $windowinfo = &Apache::lonmenu::close(); |
|
|
# ---------------------------------------------------------------- Get handover |
# ---------------------------------------------------------------- Get handover |
|
|
my ($is_balancer,$setcookie,$newcookieid,$otherbalcookie); |
my ($is_balancer,$setcookie,$newcookieid,$otherbalcookie); |
Line 336 sub handler {
|
Line 347 sub handler {
|
} |
} |
if ($env{'request.linkprot'}) { |
if ($env{'request.linkprot'}) { |
$info{'linkprot'} = $env{'request.linkprot'}; |
$info{'linkprot'} = $env{'request.linkprot'}; |
foreach my $item ('linkprotuser','linkprotexit') { |
foreach my $item ('linkprotuser','linkprotexit','linkprotpbid','linkprotpburl') { |
if ($env{'request.'.$item}) { |
if ($env{'request.'.$item}) { |
$info{$item} = $env{'request.'.$item}; |
$info{$item} = $env{'request.'.$item}; |
} |
} |
Line 347 sub handler {
|
Line 358 sub handler {
|
if ($env{'request.deeplink.login'}) { |
if ($env{'request.deeplink.login'}) { |
$info{'deeplink.login'} = $env{'request.deeplink.login'}; |
$info{'deeplink.login'} = $env{'request.deeplink.login'}; |
} |
} |
|
if ($env{'request.lti.login'}) { |
|
$info{'lti.login'} = $env{'request.lti.login'}; |
|
} |
|
if ($env{'request.lti.uri'}) { |
|
$info{'lti.uri'} = $env{'request.lti.uri'}; |
|
} |
|
if ($env{'request.lti.reqcrs'}) { |
|
$info{'lti.reqcrs'} = $env{'request.lti.reqcrs'}; |
|
} |
|
if ($env{'request.lti.reqrole'}) { |
|
$info{'lti.reqrole'} = $env{'request.lti.reqrole'}; |
|
} |
|
if ($env{'request.lti.selfenrollrole'}) { |
|
$info{'lti.selfenrollrole'} = $env{'request.lti.selfenrollrole'}; |
|
} |
|
if ($env{'request.lti.sourcecrs'}) { |
|
$info{'lti.sourcecrs'} = $env{'request.lti.sourcecrs'}; |
|
} |
|
if ($env{'request.lti.passbackid'}) { |
|
$info{'lti.passbackid'} = $env{'request.lti.passbackid'}; |
|
} |
|
if ($env{'request.lti.passbackurl'}) { |
|
$info{'lti.passbackurl'} = $env{'request.lti.passbackurl'}; |
|
} |
|
if ($env{'request.lti.rosterid'}) { |
|
$info{'lti.rosterid'} = $env{'request.lti.rosterid'}; |
|
} |
|
if ($env{'request.lti.rosterurl'}) { |
|
$info{'lti.rosterurl'} = $env{'request.lti.rosterurl'}; |
|
} |
|
if ($env{'request.lti.target'}) { |
|
$info{'lti.target'} = $env{'request.lti.target'}; |
|
} |
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 @args = ("domain=$env{'user.domain'}", |
"username=$env{'user.name'}", |
"username=$env{'user.name'}", |
Line 359 sub handler {
|
Line 403 sub handler {
|
$url .= join('&',@args); |
$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, $windowinfo.$ssologoutscript, |
|
$env{'form.lcssowin'}); |
} |
} |
|
|
1; |
1; |