Diff for /loncom/lti/ltiauth.pm between versions 1.26 and 1.27

version 1.26, 2021/11/22 23:41:00 version 1.27, 2021/11/24 04:25:03
Line 640  sub handler { Line 640  sub handler {
 #  #
 # If LON-CAPA course is a Community, and LON-CAPA role  # If LON-CAPA course is a Community, and LON-CAPA role
 # indicated is cc, change role indicated to co.  # indicated is cc, change role indicated to co.
 #   #
   
     my %crsenv;      my %crsenv;
     if ($lcroles[0] eq 'cc') {      if ($lcroles[0] eq 'cc') {
Line 745  sub handler { Line 745  sub handler {
     }      }
   
 #  #
 # Store consumer-to-LON-CAPA course mapping  # Retrieve course type of LON-CAPA course to check if mapping from a Consumer
   # course identifier permitted for this type of course (one of: official,
   # unofficial, community, textbook, placement or lti.
   #
   
       unless (%crsenv) {
           %crsenv = &Apache::lonnet::coursedescription($cdom.'_'.$cnum);
       }
       my $crstype = lc($crsenv{'type'});
       if ($crstype eq '') {
           $crstype = 'course';
       }
       if ($crstype eq 'course') {
           if ($crsenv{'internal.coursecode'}) {
               $crstype = 'official';
           } elsif ($crsenv{'internal.textbook'}) {
               $crstype = 'textbook';
           } elsif ($crsenv{'internal.lti'}) {
               $crstype = 'lti';
           } else {
               $crstype = 'unofficial';
           }
       }
   
   #
   # Store consumer-to-LON-CAPA course mapping if permitted
 #  #
   
     if (($sourcecrs ne '')  && ($consumers{$sourcecrs} eq '') && ($cnum ne '')) {      if (($lti{$itemid}{'storecrs'}) && ($sourcecrs ne '') && 
         &Apache::lonnet::put_dom('lticonsumers',{ $sourcecrs => $cnum },$cdom);          ($consumers{$sourcecrs} eq '') && ($cnum ne '')) {
           if (ref($lti{$itemid}{'mapcrstype'}) eq 'ARRAY') {
               if (grep(/^$crstype$/,@{$lti{$itemid}{'mapcrstype'}})) {
                   &Apache::lonnet::put_dom('lticonsumers',{ $sourcecrs => $cnum },$cdom);
               }
           }
     }      }
   
 #  #

Removed from v.1.26  
changed lines
  Added in v.1.27


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>