version 1.39, 2018/03/23 01:01:29
|
version 1.41, 2018/07/04 16:58:19
|
Line 166 sub handler {
|
Line 166 sub handler {
|
} |
} |
|
|
#remove session env, and log event |
#remove session env, and log event |
unlink($handle); |
if (unlink($handle)) { |
if ($env{'user.linkedenv'} ne '') { |
if ($env{'user.linkedenv'} ne '') { |
my $lonidsdir=$r->dir_config('lonIDsDir'); |
my $lonidsdir=$r->dir_config('lonIDsDir'); |
if ((-l $env{'user.linkedenv'}) && |
if (($env{'user.linkedenv'} =~ /^[a-f0-9]+_linked$/) && |
(readlink($env{'user.linkedenv'}) eq "$lonidsdir/$handle.id")) { |
(-l "$lonidsdir/$env{'user.linkedenv'}.id") && |
unlink($env{'user.linkedenv'}); |
(readlink("$lonidsdir/$env{'user.linkedenv'}.id") eq $handle)) { |
|
unlink("$lonidsdir/$env{'user.linkedenv'}.id"); |
|
} |
} |
} |
} |
} |
my %temp=('switchserver' => time.':'.$env{'form.otherserver'}, |
my %temp=('switchserver' => time.':'.$env{'form.otherserver'}, |
Line 193 sub handler {
|
Line 195 sub handler {
|
|
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
|
|
#expire the cookie |
#expire the cookies |
my $c = new CGI::Cookie(-name => 'lonID', |
my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); |
-value => '', |
foreach my $name (keys(%cookies)) { |
-expires => '-10y',); |
next unless ($name =~ /^lon(|S|Link|Pub)ID$/); |
$r->headers_out->add('Set-cookie' => $c); |
my $c = new CGI::Cookie(-name => $name, |
if ($env{'user.linkedenv'}) { |
-value => '', |
my $linked = new CGI::Cookie(-name => 'lonLinkID', |
-expires => '-10y',); |
-value => '', |
$r->headers_out->add('Set-cookie' => $c); |
-expires => '-10y',); |
|
$r->headers_out->add('Set-cookie' => $linked); |
|
} |
} |
|
|
if ($r->header_only) { |
if ($r->header_only) { |
$r->send_http_header; |
$r->send_http_header; |
return OK; |
return OK; |
Line 235 sub handler {
|
Line 234 sub handler {
|
if ($env{'request.lti.login'}) { |
if ($env{'request.lti.login'}) { |
$info{'lti.login'} = $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'}) { |
if ($env{'request.lti.reqcrs'}) { |
$info{'lti.reqcrs'} = $env{'request.lti.reqcrs'}; |
$info{'lti.reqcrs'} = $env{'request.lti.reqcrs'}; |
} |
} |
Line 259 sub handler {
|
Line 261 sub handler {
|
if ($env{'request.lti.rosterurl'}) { |
if ($env{'request.lti.rosterurl'}) { |
$info{'lti.rosterurl'} = $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 $url =$protocol.'://'.$switch_to.'/adm/login?'. |
my $url =$protocol.'://'.$switch_to.'/adm/login?'. |
'domain='.$env{'user.domain'}. |
'domain='.$env{'user.domain'}. |