--- loncom/lontrans.pm 2021/05/03 15:27:42 1.31 +++ loncom/lontrans.pm 2021/08/08 20:51:33 1.34 @@ -1,7 +1,7 @@ # The LearningOnline Network # URL translation for User Files # -# $Id: lontrans.pm,v 1.31 2021/05/03 15:27:42 raeburn Exp $ +# $Id: lontrans.pm,v 1.34 2021/08/08 20:51:33 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -67,7 +67,8 @@ sub handler { my ($redirect,$remote_ip); if ($hdrhost eq $alias) { $remote_ip = &Apache::lonnet::get_requestor_ip($r,REMOTE_NOLOOKUP); - if ($vpnext && &Apache::lonnet::ip_match($remote_ip,$vpnext)) { + if (($vpnext && &Apache::lonnet::ip_match($remote_ip,$vpnext)) && + ($r->uri !~ m{^/adm/(lti|launch)/})) { $redirect = $hostname; if ($redirect eq $hdrhost) { undef($redirect); @@ -77,9 +78,10 @@ sub handler { $remote_ip = &Apache::lonnet::get_requestor_ip($r,REMOTE_NOLOOKUP,1); unless (($remote_ip eq '127.0.0.1') || ($remote_ip eq '::1') || ($remote_ip eq &Apache::lonnet::get_host_ip($lonhost)) || + ($r->uri=~m{^/adm/(lti|launch)/}) || ($vpnint && &Apache::lonnet::ip_match($remote_ip,$vpnint))) { $redirect = $alias; - if (($r->uri=~m{^/raw/}) || ($r->uri=~m{^/adm/dns/(hosts|domain)$})) { + if (($r->uri=~m{^/raw/}) || ($r->uri=~m{^/adm/dns/})) { my %iphost = &Apache::lonnet::get_iphost(); if (exists($iphost{$remote_ip})) { undef($redirect); @@ -89,6 +91,10 @@ sub handler { } if ($redirect) { my $uri = $r->uri; + if (($uri eq '/adm/sso') || ($uri eq '/adm/switchserver') || + ($uri =~ m{^/Shibboleth.sso/})) { + return DECLINED; + } unless ($uri eq '/adm/migrateuser') { my %user; my $handle = &Apache::lonnet::check_for_valid_session($r,undef,\%user); @@ -107,6 +113,9 @@ sub handler { $protocol = 'https'; } my $querystring = $r->args; + if ($uri =~ m{^(/adm/css/)(.+)(.css)$}) { + $uri = $1.&escape($2).$3; + } my $location = $protocol.'://'.$redirect.$uri; if ($querystring) { $location .= "?$querystring"; 500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.