[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lon-capa-cvs
Subject:    [LON-CAPA-cvs] cvs: loncom /auth migrateuser.pm /interface lontiny.pm
From:       raeburn via LON-CAPA-cvs <lon-capa-cvs () mail ! lon-capa ! org>
Date:       2024-02-10 14:12:33
Message-ID: cvsraeburn1707574353 () cvsserver
[Download RAW message or body]

raeburn		Sat Feb 10 14:12:33 2024 EDT

  Modified files:              
    /loncom/interface	lontiny.pm 
    /loncom/auth	migrateuser.pm 
  Log:
  - Bug 6907.
    Update values for request.linkprotexit, request.linkprotpbid, and
    request.linkprotpburl in %env if deep-link is followed and launch URL
    unchanged but their values changed (e.g., different Consumer deep-link).
  
  
Index: loncom/interface/lontiny.pm
diff -u loncom/interface/lontiny.pm:1.21 loncom/interface/lontiny.pm:1.22
--- loncom/interface/lontiny.pm:1.21	Fri Feb  9 20:08:16 2024
+++ loncom/interface/lontiny.pm	Sat Feb 10 14:12:32 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.21 2024/02/09 20:08:16 raeburn Exp $
+# $Id: lontiny.pm,v 1.22 2024/02/10 14:12:32 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -440,35 +440,48 @@
                 }
             }
         } else {
-            if (($currdeeplinklogin ne $linkuri) ||
-                (($prevlaunch ne '') && ($currdeeplinklogin ne $prevlaunch))) {
+            unless ($currdeeplinklogin eq $linkuri) {
                 if (($linkprotector) || ($linkkey ne '')) {
-                    if ($linkprotector) {
-                        &Apache::lonnet::appenv({'request.linkprot' => \
                $linkprotector.':'.$linkproturi});
-                    } elsif ($env{'request.linkprot'}) {
-                        &Apache::lonnet::delenv('request.linkprot');
-                    }
+                    $newlauncher = 1;
+                }
+            }
+            if ($linkprotector) {
+                &Apache::lonnet::appenv({'request.linkprot' => \
$linkprotector.':'.$linkproturi}); +            } elsif ($env{'request.linkprot'}) {
+                &Apache::lonnet::delenv('request.linkprot');
+            }
+            if ($linkkey ne '') {
+                &Apache::lonnet::appenv({'request.linkkey' => $linkkey});
+            } elsif ($env{'request.linkkey'} ne '') {
+                &Apache::lonnet::delenv('request.linkkey');
+            }
+            if (($linkprotector) || ($linkkey ne '')) {
+                if ($linkprotexit ne $env{'request.linkprotexit'}) {
                     if ($linkprotexit) {
                         &Apache::lonnet::appenv({'request.linkprotexit' => \
$linkprotexit});  } elsif ($env{'request.linkprotexit'}) {
                         &Apache::lonnet::delenv('request.linkprotexit');
                     }
+                }
+                if ($linkprotpbid ne $env{'request.linkprotpbid'}) {
                     if ($linkprotpbid) {
                         &Apache::lonnet::appenv({'request.linkprotpbid' => \
$linkprotpbid});  } elsif ($env{'request.linkprotpbid'}) {
                         &Apache::lonnet::delenv('request.linkprotpbid');
                     }
+                }
+                if ($linkprotpburl ne $env{'request.linkprotpburl'}) {
                     if ($linkprotpburl) {
                         &Apache::lonnet::appenv({'request.linkprotpburl' => \
$linkprotpburl});  } elsif ($env{'request.linkprotpburl'}) {
                         &Apache::lonnet::delenv('request.linkprotpburl');
                     }
-                    if ($linkkey ne '') {
-                        &Apache::lonnet::appenv({'request.linkkey' => $linkkey});
-                    } elsif ($env{'request.linkkey'} ne '') {
-                        &Apache::lonnet::delenv('request.linkkey');
+                }
+            } elsif ($prevlaunch) {
+                foreach my $requestkey \
('linkprotpbid','linkprotpburl','linkprotexit') { +                    if \
($env{"request.$requestkey"}) { +                        \
&Apache::lonnet::delenv("request.$requestkey");  }
-                    $newlauncher = 1;
                 }
             }
             &Apache::lonnet::appenv({'request.deeplink.login' => $linkuri});
Index: loncom/auth/migrateuser.pm
diff -u loncom/auth/migrateuser.pm:1.68 loncom/auth/migrateuser.pm:1.69
--- loncom/auth/migrateuser.pm:1.68	Fri Feb  9 20:08:17 2024
+++ loncom/auth/migrateuser.pm	Sat Feb 10 14:12:33 2024
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Starts a user off based of an existing token.
 #
-# $Id: migrateuser.pm,v 1.68 2024/02/09 20:08:17 raeburn Exp $
+# $Id: migrateuser.pm,v 1.69 2024/02/10 14:12:33 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -842,10 +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'}}); +            } elsif ($env{'request.deeplink.login'}) {
+                $prevlaunch = $env{'request.deeplink.login'};
             }
             if ($data{'lti.login'}) {
                 my $needslogout;


_______________________________________________
LON-CAPA-cvs mailing list
LON-CAPA-cvs@mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic