Diff for /loncom/lti/ltiauth.pm between versions 1.8 and 1.9

version 1.8, 2018/04/14 02:30:07 version 1.9, 2018/04/21 20:34:50
Line 43  sub handler { Line 43  sub handler {
     my $r = shift;      my $r = shift;
     my $requri = $r->uri;      my $requri = $r->uri;
 #  #
   # Check for existing session, and temporarily delete any form items
   # in %env, if session exists
   #
       my %savedform;
       my $handle = &Apache::lonnet::check_for_valid_session($r);
       if ($handle ne '') {
           foreach my $key (sort(keys(%env))) {
               if ($key =~ /^form\.(.+)$/) {
                   $savedform{$1} = $env{$key};
                   delete($env{$key});
               }
           }
       }
   #
 # Retrieve data POSTed by LTI Consumer on launch    # Retrieve data POSTed by LTI Consumer on launch  
 #  #
     &Apache::lonacc::get_posted_cgi($r);      &Apache::lonacc::get_posted_cgi($r);
Line 52  sub handler { Line 66  sub handler {
             $params->{$1} = $env{$key};              $params->{$1} = $env{$key};
         }          }
     }      }
   #
   # Check for existing session, and restored temporarily
   # deleted form items to %env, if session exists.
   #
       if ($handle ne '') {
           if (keys(%savedform)) {
               foreach my $key (sort(keys(%savedform))) {
                   $env{'form.'.$key} = $savedform{$key};
               }
           }
       }
   
     unless (keys(%{$params})) {      unless (keys(%{$params})) {
         &invalid_request($r,1);          &invalid_request($r,1);
Line 140  sub handler { Line 165  sub handler {
 # Order is:  # Order is:
 #  #
 # (a) from custom_coursedomain item in POSTed data  # (a) from custom_coursedomain item in POSTed data
 # (b) from tail of requested URL (after /adm/lti) if it has format of a symb    # (b) from tail of requested URL (after /adm/lti/) if it has format of a symb  
 # (c) from tail of requested URL (after /adm/lti) if it has format of a map   # (c) from tail of requested URL (after /adm/lti) if it has format of a map 
 # (d) from tail of requested URL (after /adm/lti) if it has format /domain/courseID  # (d) from tail of requested URL (after /adm/lti) if it has format /domain/courseID
 # (e) from tail of requested URL (after /adm/lti) if it has format /tiny/domain/\w+  # (e) from tail of requested URL (after /adm/lti) if it has format /tiny/domain/\w+
Line 182  sub handler { Line 207  sub handler {
                 $symb = $tail;                  $symb = $tail;
                 $symb =~ s{^/+}{};                  $symb =~ s{^/+}{};
             }              }
           } elsif ($tail =~ m{^/res/(?:$match_domain)/(?:$match_username)/.+\.(?:sequence|page)(|___\d+___.+)$}) {
               if ($1 eq '') {
                   $mapurl = $tail;
               } else {
                   $symb = $tail;
                   $symb =~ s{^/+}{};
               }
         } elsif ($tail =~ m{^/($match_domain)/($match_courseid)$}) {          } elsif ($tail =~ m{^/($match_domain)/($match_courseid)$}) {
             ($urlcdom,$urlcnum) = ($1,$2);              ($urlcdom,$urlcnum) = ($1,$2);
             if (($cdom ne '') && ($cdom ne $urlcdom)) {              if (($cdom ne '') && ($cdom ne $urlcdom)) {
Line 329  sub handler { Line 361  sub handler {
 #  #
 # (a) from course mapping (if the link between Consumer "course" and   # (a) from course mapping (if the link between Consumer "course" and 
 # Provider "course" has been established previously).  # Provider "course" has been established previously).
 # (b) from tail of requested URL (after /adm/lti) if it has format of a symb  # (b) from tail of requested URL (after /adm/lti/) if it has format of a symb
 # (c) from tail of requested URL (after /adm/lti) if it has format of a map  # (c) from tail of requested URL (after /adm/lti) if it has format of a map
 # (d) from tail of requested URL (after /adm/lti) if it has format /domain/courseID  # (d) from tail of requested URL (after /adm/lti) if it has format /domain/courseID
 # (e) from tail of requested URL (after /adm/lti) if it has format /tiny/domain/\w+  # (e) from tail of requested URL (after /adm/lti) if it has format /tiny/domain/\w+
Line 823  sub lti_session { Line 855  sub lti_session {
             } elsif ($tail =~ m{^\Q/tiny/$cdom/\E\w+$}) {              } elsif ($tail =~ m{^\Q/tiny/$cdom/\E\w+$}) {
                 $env{'form.origurl'} = $tail;                  $env{'form.origurl'} = $tail;
                 $env{'request.lti.uri'} = $tail;                  $env{'request.lti.uri'} = $tail;
               } elsif ($tail eq "/$cdom/$cnum") {
                   $env{'form.origurl'} = '/adm/navmaps';
                   $env{'request.lti.uri'} = $tail;
             } else {              } else {
                 unless ($tail eq '/adm/roles') {                  unless ($tail eq '/adm/roles') {
                     $env{'form.origurl'} = '/adm/navmaps';                      $env{'form.origurl'} = '/adm/navmaps';

Removed from v.1.8  
changed lines
  Added in v.1.9


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