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

raeburn raeburn at source.lon-capa.org
Sun May 24 07:25:29 EDT 2020


raeburn		Sun May 24 11:25:29 2020 EDT

  Modified files:              
    /loncom/auth	migrateuser.pm 
  Log:
  - Bug 6754 LON-CAPA as LTI provider.
    Load role for user with new role added following launch from LTI Consumer.  
  
  
Index: loncom/auth/migrateuser.pm
diff -u loncom/auth/migrateuser.pm:1.46 loncom/auth/migrateuser.pm:1.47
--- loncom/auth/migrateuser.pm:1.46	Sun Mar 15 23:04:11 2020
+++ loncom/auth/migrateuser.pm	Sun May 24 11:25:29 2020
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Starts a user off based of an existing token.
 #
-# $Id: migrateuser.pm,v 1.46 2020/03/15 23:04:11 raeburn Exp $
+# $Id: migrateuser.pm,v 1.47 2020/05/24 11:25:29 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -827,14 +827,24 @@
 	    }
 	} else {
             my $desturl = '/adm/roles';
-            if ($data{'origurl'} ne '') {
-                $desturl = $data{'origurl'};
-                if ($data{'lti.login'}) {
-                    $desturl = $data{'origurl'};
+            if ($data{'lti.login'}) { 
+                if ($data{'lti.selfenrollrole'}) {
+                    $desturl .= '?selectrole=1&'.
+                                &escape($data{'lti.selfenrollrole'}).'=1';
+                    if ($data{'origurl'} ne '') {
+                        $desturl .= '&orgurl='.$data{'origurl'};
+                        if ($data{'origurl'} =~ m{/default_\d+\.sequence$}) {
+                            $desturl .= '&navmap=1';
+                        }  
+                    }
+                } elsif ($data{'origurl'} ne '') {
+                    $desturl = $data{'origurl'}; 
                     if ($desturl =~ m{/default_\d+\.sequence$}) {
                         $desturl .= (($desturl =~/\?/)?'&':'?').'navmap=1';
                     }
                 }
+            } elsif ($data{'origurl'} ne '') {
+                $desturl = $data{'origurl'};
                 if ($data{'linkprot'}) {
                     my ($linkprotector,$linkuri) = split(/:/,$data{'linkprot'},2);
                     if ($linkprotector) {




More information about the LON-CAPA-cvs mailing list