[LON-CAPA-cvs] cvs: loncom /auth migrateuser.pm /interface lontiny.pm
raeburn
raeburn at source.lon-capa.org
Sat Jul 2 15:55:15 EDT 2022
raeburn Sat Jul 2 19:55:15 2022 EDT
Modified files:
/loncom/interface lontiny.pm
/loncom/auth migrateuser.pm
Log:
- Bug 6907
"Exit Tool" button available to logout a session launched via deep link
and escape iframe and redirect (for LTI-protected link).
Index: loncom/interface/lontiny.pm
diff -u loncom/interface/lontiny.pm:1.14 loncom/interface/lontiny.pm:1.15
--- loncom/interface/lontiny.pm:1.14 Sat Jul 2 17:23:02 2022
+++ loncom/interface/lontiny.pm Sat Jul 2 19:55:15 2022
@@ -2,7 +2,7 @@
# Extract domain, courseID, and symb from a shortened URL,
# and switch role to a role in designated course.
#
-# $Id: lontiny.pm,v 1.14 2022/07/02 17:23:02 raeburn Exp $
+# $Id: lontiny.pm,v 1.15 2022/07/02 19:55:15 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -289,7 +289,7 @@
sub launch_check {
my ($linkuri,$symb) = @_;
- my ($linkprotector,$linkproturi,$linkkey,$newlauncher);
+ my ($linkprotector,$linkproturi,$linkprotexit,$linkkey,$newlauncher);
if ($env{'form.ttoken'}) {
my %link_info = &Apache::lonnet::tmpget($env{'form.ttoken'});
&Apache::lonnet::tmpdel($env{'form.ttoken'});
@@ -327,6 +327,9 @@
} else {
&Apache::lonnet::appenv({'user.linkproturi' => $linkproturi});
}
+ if ($link_info{'linkprotexit'}) {
+ $linkprotexit = $link_info{'linkprotexit'};
+ }
} elsif ($link_info{'linkkey'} ne '') {
$linkkey = $link_info{'linkkey'};
my $keyedlinkuri = $linkuri;
@@ -366,7 +369,7 @@
}
if ($deeplink ne '') {
my $disallow;
- my ($state,$others,$listed,$scope,$protect,$display,$target) = split(/,/,$deeplink);
+ my ($state,$others,$listed,$scope,$protect,$display,$target,$exit) = split(/,/,$deeplink);
if (($protect ne 'none') && ($protect ne '')) {
my ($acctype,$item) = split(/:/,$protect);
if ($acctype =~ /lti(c|d)$/) {
@@ -394,6 +397,12 @@
if ($env{'request.deeplink.target'} ne '') {
&Apache::lonnet::delenv('request.deeplink.target');
}
+ if ($env{'request.linkprot'} ne '') {
+ &Apache::lonnet::delenv('request.linkprot');
+ }
+ if ($env{'request.linkprotexit'} ne '') {
+ &Apache::lonnet::delenv('request.linkprotexit');
+ }
}
} else {
unless ($currdeeplinklogin eq $linkuri) {
@@ -403,6 +412,11 @@
} elsif ($env{'request.linkprot'}) {
&Apache::lonnet::delenv('request.linkprot');
}
+ if ($linkprotexit) {
+ &Apache::lonnet::appenv({'request.linkprotexit' => $linkprotexit});
+ } elsif ($env{'request.linkprotexit'}) {
+ &Apache::lonnet::delenv('request.linkprotexit');
+ }
if ($linkkey ne '') {
&Apache::lonnet::appenv({'request.linkkey' => $linkkey});
} elsif ($env{'request.linkkey'} ne '') {
@@ -424,6 +438,11 @@
} elsif ($env{'request.linkprot'}) {
&Apache::lonnet::delenv('request.linkprot');
}
+ if ($linkprotexit) {
+ &Apache::lonnet::appenv({'request.linkprotexit' => $linkprotexit});
+ } elsif ($env{'request.linkprotexit'}) {
+ &Apache::lonnet::delenv('request.linkprotexit');
+ }
if ($linkkey ne '') {
&Apache::lonnet::appenv({'request.linkkey' => $linkkey});
} else {
Index: loncom/auth/migrateuser.pm
diff -u loncom/auth/migrateuser.pm:1.63 loncom/auth/migrateuser.pm:1.64
--- loncom/auth/migrateuser.pm:1.63 Thu Jun 30 21:04:13 2022
+++ loncom/auth/migrateuser.pm Sat Jul 2 19:55:15 2022
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Starts a user off based of an existing token.
#
-# $Id: migrateuser.pm,v 1.63 2022/06/30 21:04:13 raeburn Exp $
+# $Id: migrateuser.pm,v 1.64 2022/07/02 19:55:15 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -744,6 +744,9 @@
unless ($env{'request.linkprot'} eq $data{'linkprot'}) {
$checklaunch = 1;
}
+ unless ($env{'request.linkprotexit'} eq $data{'linkprotexit'}) {
+ $checklaunch = 1;
+ }
unless ($env{'request.linkkey'} eq $data{'linkkey'}) {
$checklaunch = 1;
}
@@ -755,7 +758,7 @@
if (($env{'user.name'} ne $data{'username'}) ||
($env{'user.domain'} ne $data{'domain'})) {
my %linkprot_env;
- foreach my $item ('linkprot','deeplink.login') {
+ foreach my $item ('linkprot','linkprotexit','deeplink.login') {
if ($data{$item}) {
$linkprot_env{$item} = $data{$item};
}
@@ -764,6 +767,9 @@
return OK;
}
&Apache::lonnet::appenv({'request.linkprot' => $data{'linkprot'}});
+ if ($data{'linkprotexit'}) {
+ &Apache::lonnet::appenv({'request.linkprotexit' => $data{'linkprotexit'}});
+ }
if ($env{'request.linkkey'}) {
&Apache::lonnet::delenv('request.linkkey');
}
@@ -958,6 +964,9 @@
'user.linkproturi' => $linkuri,
'request.linkprot' => $data{'linkprot'}};
}
+ if ($data{'linkprotexit'}) {
+ $extra_env->{'request.linkprotexit'} = $data{'linkprotexit'};
+ }
}
foreach my $item ('linkprotuser','linkprotexit') {
if ($data{$item} ne '') {
@@ -1061,6 +1070,9 @@
}
if ($data{'linkprot'}) {
$extra_env->{'request.linkprot'} = $data{'linkprot'};
+ if ($data{'linkprotexit'}) {
+ $extra_env->{'request.linkprotexit'} = $data{'linkprotexit'};
+ }
foreach my $item ('linkprotuser','linkprotexit') {
if ($data{$item}) {
$form{'request.'.$item} = $data{$item};
More information about the LON-CAPA-cvs
mailing list