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

raeburn raeburn at source.lon-capa.org
Wed May 25 14:03:43 EDT 2022


raeburn		Wed May 25 18:03:43 2022 EDT

  Modified files:              
    /loncom/interface	lontiny.pm 
  Log:
  - Bug 6907
    Remove request.deeplink.target, if set, when deeplink no longer in effect.
  
  
Index: loncom/interface/lontiny.pm
diff -u loncom/interface/lontiny.pm:1.9 loncom/interface/lontiny.pm:1.10
--- loncom/interface/lontiny.pm:1.9	Tue May 24 16:23:04 2022
+++ loncom/interface/lontiny.pm	Wed May 25 18:03:43 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.9 2022/05/24 16:23:04 raeburn Exp $
+# $Id: lontiny.pm,v 1.10 2022/05/25 18:03:43 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -256,6 +256,18 @@
         my %link_info = &Apache::lonnet::tmpget($env{'form.ttoken'});
         &Apache::lonnet::tmpdel($env{'form.ttoken'});
         delete($env{'form.ttoken'});
+        if ($link_info{'ltoken'}) {
+            unless (($link_info{'linkprot'}) || ($link_info{'linkkey'} ne '')) {
+                my %ltoken_info = &Apache::lonnet::tmpget($link_info{'ltoken'});
+                if ($ltoken_info{'linkprot'}) {
+                    $link_info{'linkprot'} = $ltoken_info{'linkprot'};
+                } elsif ($ltoken_info{'linkkey'} ne '') {
+                    $link_info{'linkkey'} = $ltoken_info{'linkkey'};
+                }
+            }
+            &Apache::lonnet::tmpdel($env{'form.ltoken'});
+            delete($env{'form.ltoken'});
+        }
         if ($link_info{'linkprot'}) {
             ($linkprotector,$linkproturi) = split(/:/,$link_info{'linkprot'},2);
             if ($env{'user.linkprotector'}) {
@@ -342,6 +354,9 @@
         if ($disallow) {
             if ($currdeeplinklogin eq $linkuri) {
                 &Apache::lonnet::delenv('request.deeplink.login');
+                if ($env{'request.deeplink.target'} ne '') {
+                    &Apache::lonnet::delenv('request.deeplink.target');
+                }
             }
         } else {
             unless ($currdeeplinklogin eq $linkuri) {
@@ -362,6 +377,8 @@
             &Apache::lonnet::appenv({'request.deeplink.login' => $linkuri});
             if ($target ne '') {
                 &Apache::lonnet::appenv({'request.deeplink.target' => $target});
+            } elsif ($env{'request.deeplink.target'} ne '') {
+                &Apache::lonnet::delenv('request.deeplink.target');
             }
         }
     } else {
@@ -376,6 +393,9 @@
             &Apache::lonnet::delenv({'request.linkkey'});
         }
         &Apache::lonnet::appenv({'request.deeplink.login' => $linkuri});
+        if ($env{'request.deeplink.target'} ne '') {
+            &Apache::lonnet::delenv('request.deeplink.target');
+        }
     }
     return $newlauncher;
 }




More information about the LON-CAPA-cvs mailing list