version 1.159.2.21.2.6, 2024/02/28 20:31:02
|
version 1.210, 2023/08/28 20:40:00
|
Line 160 sub get_posted_cgi {
|
Line 160 sub get_posted_cgi {
|
if (length($value) == 1) { |
if (length($value) == 1) { |
$value=~s/[\r\n]$//; |
$value=~s/[\r\n]$//; |
} |
} |
} |
} |
if ($fname =~ /\.(xls|doc|ppt)(x|m)$/i) { |
if ($fname =~ /\.(xls|doc|ppt)(x|m)$/i) { |
$value=~s/[\r\n]$//; |
$value=~s/[\r\n]$//; |
} |
} |
Line 586 sub sso_login {
|
Line 586 sub sso_login {
|
} else { |
} else { |
# need to login them in, so generate the need data that |
# need to login them in, so generate the need data that |
# migrate expects to do login |
# migrate expects to do login |
my $ip = &Apache::lonnet::get_requestor_ip($r); |
my $ip = &Apache::lonnet::get_requestor_ip($r); |
my %info=('ip' => $ip, |
my %info=('ip' => $ip, |
'domain' => $domain, |
'domain' => $domain, |
'username' => $user, |
'username' => $user, |
Line 792 sub handler {
|
Line 792 sub handler {
|
my $lonhost = &Apache::lonnet::host_from_dns($hostname); |
my $lonhost = &Apache::lonnet::host_from_dns($hostname); |
if ($lonhost) { |
if ($lonhost) { |
my $actual = &Apache::lonnet::absolute_url($hostname,1,1); |
my $actual = &Apache::lonnet::absolute_url($hostname,1,1); |
|
my $exphostname = &Apache::lonnet::hostname($lonhost); |
my $expected = $Apache::lonnet::protocol{$lonhost}.'://'.$hostname; |
my $expected = $Apache::lonnet::protocol{$lonhost}.'://'.$hostname; |
unless ($actual eq $expected) { |
unless ($actual eq $expected) { |
$env{'request.use_absolute'} = $expected; |
$env{'request.use_absolute'} = $expected; |
Line 890 sub handler {
|
Line 891 sub handler {
|
return FORBIDDEN; |
return FORBIDDEN; |
} |
} |
return OK; |
return OK; |
|
} elsif (($env{'request.course.id'}) && |
|
(&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) && |
|
($requrl=~m{^(/daxeopen|)(/uploaded/$cdom/$cnum/(?:docs|supplemental)/(?:default|\d+)/\d+/)([^/]+|)$})) { |
|
my ($daxe,$path,$file) = ($1,$2,$3); |
|
my $referrer; |
|
unless ($daxe) { |
|
$referrer = $r->headers_in->{'Referer'}; |
|
} |
|
if (($daxe) || ($referrer =~ m{\Qfile=/daxeopen$path\E})) { |
|
return OK; |
|
} |
} |
} |
# ---------------------------------------------------------------- Check access |
# ---------------------------------------------------------------- Check access |
my $now = time; |
my $now = time; |
Line 963 sub handler {
|
Line 975 sub handler {
|
} |
} |
} else { |
} else { |
my $nodeeplinkcheck; |
my $nodeeplinkcheck; |
if (($check_access) && ($requrl =~ /\.(sequence|page)$/)) { |
if ($check_access) { |
unless ($env{'form.navmap'}) { |
if ($requrl =~ m{^/daxeopen/priv/}) { |
if ($r->args ne '') { |
$nodeeplinkcheck = 1; |
&Apache::loncommon::get_unprocessed_cgi($r->args,['navmap']); |
} elsif ($requrl =~ /\.(sequence|page)$/) { |
unless ($env{'form.navmap'}) { |
unless ($env{'form.navmap'}) { |
$nodeeplinkcheck = 1; |
if ($r->args ne '') { |
|
&Apache::loncommon::get_unprocessed_cgi($r->args,['navmap']); |
|
unless ($env{'form.navmap'}) { |
|
$nodeeplinkcheck = 1; |
|
} |
} |
} |
} |
} |
} |
} |
} |
} |
my $clientip = &Apache::lonnet::get_requestor_ip($r); |
my $clientip = &Apache::lonnet::get_requestor_ip($r); |
$access=&Apache::lonnet::allowed('bre',$requrl,'','',$clientip,'','',$nodeeplinkcheck); |
$access=&Apache::lonnet::allowed('bre',$requrl,'','',$clientip,'','',$nodeeplinkcheck); |
|
if (($requrl =~ m{^/daxeopen/priv/}) && ($access eq '')) { |
|
$env{'request.editurl'}=$requrl; |
|
} |
} |
} |
} |
} |
if ($check_block) { |
if ($check_block) { |
Line 1187 sub handler {
|
Line 1206 sub handler {
|
my $mapsymb = &Apache::lonnet::symbread($map); |
my $mapsymb = &Apache::lonnet::symbread($map); |
($map,$mid,$murl)=&Apache::lonnet::decode_symb($mapsymb); |
($map,$mid,$murl)=&Apache::lonnet::decode_symb($mapsymb); |
} |
} |
&Apache::lonnet::symblist($map,$murl =>[$murl,$mid], |
&Apache::lonnet::symblist($map,$murl =>[$murl,$mid], |
'last_known' =>[$murl,$mid]); |
'last_known' =>[$murl,$mid]); |
} |
} |
} |
} |
} |
} |
Line 1241 sub handler {
|
Line 1260 sub handler {
|
# ------------------------------------ See if this is a viewable portfolio file |
# ------------------------------------ See if this is a viewable portfolio file |
if (&Apache::lonnet::is_portfolio_url($requrl)) { |
if (&Apache::lonnet::is_portfolio_url($requrl)) { |
my $clientip = &Apache::lonnet::get_requestor_ip($r); |
my $clientip = &Apache::lonnet::get_requestor_ip($r); |
my $access=&Apache::lonnet::allowed('bre',$requrl,undef,undef,$clientip); |
my $access=&Apache::lonnet::allowed('bre',$requrl,undef,undef,$clientip); |
if ($access eq 'A') { |
if ($access eq 'A') { |
&Apache::restrictedaccess::setup_handler($r); |
&Apache::restrictedaccess::setup_handler($r); |
return OK; |
return OK; |