[LON-CAPA-cvs] cvs: loncom /auth migrateuser.pm /interface lontiny.pm

raeburn raeburn at source.lon-capa.org
Fri Feb 9 15:08:17 EST 2024


raeburn		Fri Feb  9 20:08:17 2024 EDT

  Modified files:              
    /loncom/interface	lontiny.pm 
    /loncom/auth	migrateuser.pm 
  Log:
  - Bug 6907.
    Update values for request.linkprot, request.linkprotexit, request.linkprotpbid
    and request.linkprotpburl if deep-link is followed from same Consumer as
    already in use for current session, but launch URL is different.
  
  
Index: loncom/interface/lontiny.pm
diff -u loncom/interface/lontiny.pm:1.20 loncom/interface/lontiny.pm:1.21
--- loncom/interface/lontiny.pm:1.20	Sun Jun  4 00:36:18 2023
+++ loncom/interface/lontiny.pm	Fri Feb  9 20:08:16 2024
@@ -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.20 2023/06/04 00:36:18 raeburn Exp $
+# $Id: lontiny.pm,v 1.21 2024/02/09 20:08:16 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -308,7 +308,8 @@
 
 sub launch_check {
     my ($linkuri,$symb) = @_;
-    my ($linkprotector,$linkproturi,$linkprotexit,$linkprotpbid,$linkprotpburl,$linkkey,$newlauncher);
+    my ($linkprotector,$linkproturi,$linkprotexit,$linkprotpbid,$linkprotpburl,
+        $linkkey,$newlauncher,$prevlaunch);
     if ($env{'form.ttoken'}) {
         my %link_info = &Apache::lonnet::tmpget($env{'form.ttoken'});
         &Apache::lonnet::tmpdel($env{'form.ttoken'});
@@ -380,6 +381,9 @@
         if ($link_info{'checklaunch'}) {
             $newlauncher = 1;
         }
+        if ($link_info{'prevlaunch'} ne '') {
+            $prevlaunch = $link_info{'prevlaunch'};
+        }
     }
     my $currdeeplinklogin = $env{'request.deeplink.login'};
     my $deeplink;
@@ -436,7 +440,8 @@
                 }
             }
         } else {
-            unless ($currdeeplinklogin eq $linkuri) {
+            if (($currdeeplinklogin ne $linkuri) ||
+                (($prevlaunch ne '') && ($currdeeplinklogin ne $prevlaunch))) {
                 if (($linkprotector) || ($linkkey ne '')) {
                     if ($linkprotector) {
                         &Apache::lonnet::appenv({'request.linkprot' => $linkprotector.':'.$linkproturi});
Index: loncom/auth/migrateuser.pm
diff -u loncom/auth/migrateuser.pm:1.67 loncom/auth/migrateuser.pm:1.68
--- loncom/auth/migrateuser.pm:1.67	Fri Jun  2 01:20:26 2023
+++ loncom/auth/migrateuser.pm	Fri Feb  9 20:08:17 2024
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Starts a user off based of an existing token.
 #
-# $Id: migrateuser.pm,v 1.67 2023/06/02 01:20:26 raeburn Exp $
+# $Id: migrateuser.pm,v 1.68 2024/02/09 20:08:17 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -752,7 +752,7 @@
 	if ($handle) {
 	    &Apache::lonnet::transfer_profile_to_env($r->dir_config('lonIDsDir'),
 						     $handle);
-            my $checklaunch;
+            my ($checklaunch,$prevlaunch);
             if ($data{'origurl'} =~ m{^/tiny/$match_domain/\w+$}) {
                 unless ($env{'request.linkprot'} eq $data{'linkprot'}) {
                     $checklaunch = 1;
@@ -842,6 +842,9 @@
                 }
             }
             if ($data{'deeplink.login'}) {
+                if (($env{'request.deeplink.login'}) && ($env{'request.deeplink.login'} ne $data{'deeplink.login'})) {
+                    $prevlaunch = $env{'request.deeplink.login'};
+                }
                 &Apache::lonnet::appenv({'request.deeplink.login' => $data{'deeplink.login'}});
             }
             if ($data{'lti.login'}) {
@@ -938,6 +941,7 @@
                     $info{'origurl'} = $data{'origurl'};
                     if ($checklaunch) {
                         $info{'checklaunch'} = 1;
+                        $info{'prevlaunch'} = $prevlaunch;
                     }
                     my $token = &Apache::lonnet::tmpput(\%info,$r->dir_config('lonHostID'),'link');
                     unless (($token eq 'con_lost') || ($token eq 'refused') || ($token =~ /^error:/) ||




More information about the LON-CAPA-cvs mailing list