[LON-CAPA-cvs] cvs: loncom /lti ltiauth.pm

raeburn raeburn at source.lon-capa.org
Mon May 7 20:44:14 EDT 2018


raeburn		Tue May  8 00:44:14 2018 EDT

  Modified files:              
    /loncom/lti	ltiauth.pm 
  Log:
  - Bug 6754 LON-CAPA as LTI Provider
    - request.lti.login set to consumer's ID for LTI authenticated session.
    - Rights to create LON-CAPA courses (LTI type) assigned, as per domain
      config to new user created for LTI instructor 
    - No "Login" shown for "Invalid call" displayed for failed LTI launch. 
  
  
Index: loncom/lti/ltiauth.pm
diff -u loncom/lti/ltiauth.pm:1.9 loncom/lti/ltiauth.pm:1.10
--- loncom/lti/ltiauth.pm:1.9	Sat Apr 21 20:34:50 2018
+++ loncom/lti/ltiauth.pm	Tue May  8 00:44:14 2018
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Basic LTI Authentication Module
 #
-# $Id: ltiauth.pm,v 1.9 2018/04/21 20:34:50 raeburn Exp $
+# $Id: ltiauth.pm,v 1.10 2018/05/08 00:44:14 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -578,7 +578,7 @@
                     if (($ltiroles[0] eq 'Instructor') && ($lcroles[0] eq 'cc') && ($lti{$itemid}{'mapcrs'}) &&
                         ($lti{$itemid}{'makecrs'})) {
                         unless (&Apache::lonnet::usertools_access($uname,$udom,'lti','reload','requestcourses')) {
-                            &Apache::lonnet::put('environment',{ 'requestcourses.lti' => 1, },$udom,$uname);
+                            &Apache::lonnet::put('environment',{ 'requestcourses.lti' => 'autolimit=', },$udom,$uname);
                         }
                     }
                 } else {
@@ -892,7 +892,7 @@
                 $env{'request.lti.rosterurl'} = $params->{'ext_ims_lis_memberships_url'};
             }
         }
-        $env{'request.lti.login'} = 1;
+        $env{'request.lti.login'} = $itemid;
         if ($params->{'launch_presentation_document_target'}) {
             $env{'request.lti.target'} = $params->{'launch_presentation_document_target'};
         }
@@ -916,7 +916,7 @@
                   'domain'    => $udom,
                   'username'  => $uname,
                   'server'    => $lonhost,
-                  'lti.login' => 1,
+                  'lti.login' => $itemid,
                   'lti.uri'   => $tail,
                  );
         if ($role) {
@@ -984,7 +984,7 @@
     }
     &Apache::lonlocal::get_language_handle($r);
     $r->print(
-        &Apache::loncommon::start_page('Invalid LTI call').
+        &Apache::loncommon::start_page('Invalid LTI call','',{ 'only_body' => 1,}).
         &mt('Invalid LTI call [_1]',$num).
         &Apache::loncommon::end_page());
     return;




More information about the LON-CAPA-cvs mailing list