Diff for /loncom/lontrans.pm between versions 1.15 and 1.17

version 1.15, 2016/07/25 19:49:45 version 1.17, 2017/11/30 15:14:58
Line 38  sub handler { Line 38  sub handler {
     my $r = shift;      my $r = shift;
     # FIXME line remove when mod_perl fixes BUG#4948       # FIXME line remove when mod_perl fixes BUG#4948 
     $r->notes->set('error-notes' => '');      $r->notes->set('error-notes' => '');
     if ($r->uri=~m{^/raw/}) {      if ($r->uri =~ m{^/adm/lti/(.+)$}) {
           my $realuri = $1;
           my %user;
           my $handle = &Apache::lonnet::check_for_valid_session($r,undef,\%user);
           if (($handle ne '') && ($user{'lti'})) {
               if ($realuri =~ m{^uploaded/$match_domain/$match_courseid/(default|supplemental)(|_\d+)\.(?:sequence|page)___\d+___.+$}) {
                   my ($map,$resid,$url) = split(/___/,$realuri);
                   $realuri = &Apache::lonnet::clutter($url).'?symb='.$realuri;
               } elsif ($realuri =~ m{($match_domain)/($match_courseid)$}) {
                   $realuri = '/adm/navmaps';
               } else {
                   $realuri = '/'.$realuri;
                   if ($realuri =~ m{/default_\d+\.sequence$}) {
                       $realuri .= (($realuri =~/\?/)?'&':'?').'navmap=1';
                   }
               }
               my $host = $r->headers_in->get('Host');
               if ($host) {
                   my $protocol = 'http';
                   if ($r->get_server_port == 443) {
                       $protocol = 'https';
                   }
                   my $location = $protocol.'://'.$host.$realuri;
                   $r->headers_out->set(Location => $location);
                   return REDIRECT;
               }
           }
       } elsif ($r->uri=~m{^/raw/}) {
         my $host = $r->headers_in->get('Host');          my $host = $r->headers_in->get('Host');
         if ($host) {          if ($host) {
             unless ($host =~ /^internal\-/) {              unless ($host =~ /^internal\-/) {
                 my $c = $r->connection;                  my $remote_ip = $r->get_remote_host();
                 if (ref($c)) {                  my $lonhost = $r->dir_config('lonHostID');
                     my $remote_ip = $c->remote_ip;                  if (&redirect_raw($remote_ip,$lonhost)) {
                     my $lonhost = $r->dir_config('lonHostID');                      my $location = 'https://internal-'.$host.$r->uri;
                     if (&redirect_raw($remote_ip,$lonhost)) {                      $r->headers_out->set(Location => $location);
                         my $location = 'https://internal-'.$host.$r->uri;                      return REDIRECT;
                         $r->headers_out->set(Location => $location);  
                         return REDIRECT;  
                     }  
                 }                  }
             }              }
         }          }

Removed from v.1.15  
changed lines
  Added in v.1.17


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