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

raeburn raeburn at source.lon-capa.org
Tue May 8 11:44:11 EDT 2018


raeburn		Tue May  8 15:44:11 2018 EDT

  Modified files:              
    /loncom/auth	lonauth.pm migrateuser.pm 
  Log:
  - Bug 6754 LON-CAPA as LTI Provider
    - Creation of new LON-CAPA course available from an LTI Consumer.
  
  
Index: loncom/auth/lonauth.pm
diff -u loncom/auth/lonauth.pm:1.151 loncom/auth/lonauth.pm:1.152
--- loncom/auth/lonauth.pm:1.151	Sat Apr 21 21:29:31 2018
+++ loncom/auth/lonauth.pm	Tue May  8 15:44:11 2018
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # User Authentication Module
 #
-# $Id: lonauth.pm,v 1.151 2018/04/21 21:29:31 raeburn Exp $
+# $Id: lonauth.pm,v 1.152 2018/05/08 15:44:11 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -106,6 +106,11 @@
                 $r->headers_out->add('Set-cookie' => $defaultcookie);
             }
             $r->send_http_header;
+            if (ref($form) eq 'HASH') {
+                $form->{'lti.reqcrs'} = $env{'request.lti.reqcrs'};
+                $form->{'lti.reqrole'} = $env{'request.lti.reqrole'};
+                $form->{'lti.sourcecrs'} = $env{'request.lti.sourcecrs'};
+            }
             &Apache::ltiauth::lti_reqcrs($r,$domain,$form,$username,$domain);
             return;
         }
Index: loncom/auth/migrateuser.pm
diff -u loncom/auth/migrateuser.pm:1.31 loncom/auth/migrateuser.pm:1.32
--- loncom/auth/migrateuser.pm:1.31	Tue Apr 17 19:48:18 2018
+++ loncom/auth/migrateuser.pm	Tue May  8 15:44:11 2018
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Starts a user off based of an existing token.
 #
-# $Id: migrateuser.pm,v 1.31 2018/04/17 19:48:18 raeburn Exp $
+# $Id: migrateuser.pm,v 1.32 2018/05/08 15:44:11 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -94,6 +94,9 @@
             if ($data->{'lti.target'}) {
                 $lti_env{'request.lti.target'} = $data->{'lti.target'};
             }
+            if ($data->{'lti.sourcecrs'}) {
+                $lti_env{'request.lti.sourcecrs'} = $data->{'lti.sourcecrs'};
+            }
         }
         if ($data->{'lti.passbackid'}) {
             $lti_env{'request.lti.passbackid'} = $data->{'lti.passbackid'};
@@ -420,7 +423,7 @@
                         delete($lti_env->{'selfenrollrole'});
                     }
                     if ($data{'lti.selfenrollrole'}) {
-                        if (&Apache::ltiauth::lti_enroll($data{'username'},data{'domain'},
+                        if (&Apache::ltiauth::lti_enroll($data{'username'},$data{'domain'},
                                                          $data{'lti.selfenrollrole'}) eq 'ok') {
                             my $url = '/adm/roles?selectrole=1&'.
                                       &escape($data{'lti.selfenrollrole'}).'=1';




More information about the LON-CAPA-cvs mailing list