version 1.357, 2021/11/28 19:18:00
|
version 1.360, 2022/02/24 13:08:59
|
Line 195 $msg
|
Line 195 $msg
|
var url = "$js_url"; |
var url = "$js_url"; |
\$(location).attr('href',url); |
\$(location).attr('href',url); |
}); |
}); |
|
// ]]> |
</script> |
</script> |
$link |
$link |
$end_page |
$end_page |
Line 277 sub handler {
|
Line 278 sub handler {
|
$update = $then; |
$update = $then; |
} |
} |
|
|
my ($norolelist,$blocked_by_ip,$blocked_type,$blocked_ipaddr); |
my ($norolelist,$blocked_by_ip,$blocked_type,$clientip); |
|
$clientip = &Apache::lonnet::get_requestor_ip($r); |
if (($env{'request.course.id'}) && ($env{'request.deeplink.login'})) { |
if (($env{'request.course.id'}) && ($env{'request.deeplink.login'})) { |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
Line 355 sub handler {
|
Line 357 sub handler {
|
unless (defined($cached)) { |
unless (defined($cached)) { |
my %domconfig = |
my %domconfig = |
&Apache::lonnet::get_dom('configuration',['ipaccess'],$cdom); |
&Apache::lonnet::get_dom('configuration',['ipaccess'],$cdom); |
$ipaccessref = &do_cache_new('ipaccess',$cdom,$domconfig{'ipaccess'},1800); |
$ipaccessref = &Apache::lonnet::do_cache_new('ipaccess',$cdom,$domconfig{'ipaccess'},1800); |
} |
} |
if (ref($ipaccessref) eq 'HASH') { |
if (ref($ipaccessref) eq 'HASH') { |
my $remote_ip = &Apache::lonnet::get_requestor_ip(); |
|
foreach my $id (keys(%{$ipaccessref})) { |
foreach my $id (keys(%{$ipaccessref})) { |
if (ref($ipaccessref->{$id}) eq 'HASH') { |
if (ref($ipaccessref->{$id}) eq 'HASH') { |
my $range = $ipaccessref->{$id}->{'ip'}; |
my $range = $ipaccessref->{$id}->{'ip'}; |
if ($range) { |
if ($range) { |
my $type = 'exclude'; |
my $type = 'exclude'; |
if (&Apache::lonnet::ip_match($remote_ip,$range)) { |
if (&Apache::lonnet::ip_match($clientip,$range)) { |
$type = 'include'; |
$type = 'include'; |
} |
} |
if (ref($ipaccessref->{$id}->{'courses'}) eq 'HASH') { |
if (ref($ipaccessref->{$id}->{'courses'}) eq 'HASH') { |
Line 386 sub handler {
|
Line 387 sub handler {
|
} |
} |
} |
} |
} |
} |
unless ($showrole) { |
|
$blocked_ipaddr = $remote_ip; |
|
} |
|
} |
} |
} |
} |
} |
} |
Line 783 ENDCLOSE
|
Line 781 ENDCLOSE
|
$r->rflush(); |
$r->rflush(); |
my ($msg,$blockcrit,$critmsg_check); |
my ($msg,$blockcrit,$critmsg_check); |
$critmsg_check = 1; |
$critmsg_check = 1; |
$blockcrit = &Apache::loncommon::blocking_status('alert',$cnum,$cdom,undef,1); |
$blockcrit = &Apache::loncommon::blocking_status('alert',$clientip,$cnum,$cdom,undef,1); |
if ($blockcrit) { |
if ($blockcrit) { |
my $checkrole = "cm./$cdom/$cnum"; |
my $checkrole = "cm./$cdom/$cnum"; |
if ($csec ne '') { |
if ($csec ne '') { |
Line 1354 ENDHEADER
|
Line 1352 ENDHEADER
|
} |
} |
$r->print('<h3><span class="LC_error">'. |
$r->print('<h3><span class="LC_error">'. |
&mt('The [_1] you selected is not available for access with a [_2] role from your current IP address: [_3].', |
&mt('The [_1] you selected is not available for access with a [_2] role from your current IP address: [_3].', |
lc($blocked_type),$blocked_role,$blocked_ipaddr). |
lc($blocked_type),$blocked_role,$clientip). |
'</span></h3>'); |
'</span></h3>'); |
} |
} |
} |
} |