--- loncom/interface/domainprefs.pm 2020/12/18 15:23:02 1.373
+++ loncom/interface/domainprefs.pm 2021/01/05 04:23:45 1.376
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.373 2020/12/18 15:23:02 raeburn Exp $
+# $Id: domainprefs.pm,v 1.376 2021/01/05 04:23:45 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -263,7 +263,7 @@ sub handler {
my @prefs_order = ('rolecolors','login','defaults','wafproxy','passwords','quotas',
'autoenroll','autoupdate','autocreate','directorysrch',
'contacts','privacy','usercreation','selfcreation',
- 'usermodification','scantron','requestcourses','requestauthor'
+ 'usermodification','scantron','requestcourses','requestauthor',
'coursecategories','serverstatuses','helpsettings','coursedefaults',
'ltitools','proctoring','selfenrollment','usersessions','ssl',
'trust','lti');
@@ -7185,6 +7185,7 @@ sub print_wafproxy {
my $datatable;
my %servers = &Apache::lonnet::internet_dom_servers($dom);
my (%othercontrol,%otherdoms,%aliases,%values,$setdom);
+ my %lt = &wafproxy_titles();
foreach my $server (sort(keys(%servers))) {
my $serverhome = &Apache::lonnet::get_server_homeID($servers{$server});
my $serverdom;
@@ -7202,7 +7203,7 @@ sub print_wafproxy {
if (ref($settings->{'alias'}) eq 'HASH') {
$aliases{$dom} = $settings->{'alias'};
}
- foreach my $item ('ipheader','trusted','exempt') {
+ foreach my $item ('ipheader','trusted','vpnint','vpnext') {
$values{$dom}{$item} = $settings->{$item};
}
}
@@ -7217,7 +7218,7 @@ sub print_wafproxy {
if (ref($config{$domain}) eq 'HASH') {
if (ref($config{$domain}{'wafproxy'}) eq 'HASH') {
$aliases{$domain} = $config{$domain}{'wafproxy'}{'alias'};
- foreach my $item ('exempt','trusted','ipheader') {
+ foreach my $item ('ipheader','trusted','vpnint','vpnext') {
$values{$domain}{$item} = $config{$domain}{'wafproxy'}{$item};
}
}
@@ -7232,7 +7233,7 @@ sub print_wafproxy {
$datatable .= '
'.
''.&mt('Hostname').': '.
&Apache::lonnet::hostname($server).' | '.
- '';
+ ' | ';
if ($othercontrol{$server}) {
my $current;
if (ref($aliases{$othercontrol{$server}}) eq 'HASH') {
@@ -7254,7 +7255,7 @@ sub print_wafproxy {
}
}
$datatable .= '';
+ 'value="'.$current.'" size="30" />';
}
$datatable .= ' |
';
}
@@ -7263,15 +7264,22 @@ sub print_wafproxy {
$itemcount ++;
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
$datatable .= ''.
- ''.&mt('Domain: [_1]',''.$dom.'').'
'.
+ ' | '.&mt('Domain: [_1]',''.$dom.'').'
'.
&mt('Format for comma separated IP blocks').': '.
&mt('A.B.C.D/N or A.B.C.D - E.F.G.H').' | '.
' |
';
}
@@ -7280,9 +7288,9 @@ sub print_wafproxy {
$itemcount ++;
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
$datatable .= ''.
- ''.&mt('Domain: [_1]',$domain).
- '';
- foreach my $item ('ipheader','trusted','exempt') {
+ ''.&mt('Domain: [_1]',$domain).' | '.
+ '';
+ foreach my $item ('ipheader','trusted','vpnint','vpnext') {
my $showval = &mt('None');
if ($values{$domain}{$item}) {
$showval = $values{$domain}{$item};
@@ -7300,7 +7308,8 @@ sub print_wafproxy {
sub wafproxy_titles {
return &Apache::lonlocal::texthash(
- exempt => 'Exempt IP range(s)',
+ vpnint => 'Internal IP Range(s) for VPN sessions',
+ vpnext => 'IP Range for backend WAF connections',
trusted => 'Trusted IP range(s)',
ipheader => 'Custom request header',
);
@@ -20713,24 +20722,24 @@ sub modify_loadbalancing {
$resulttext .= ''.&mt('Load Balancer: [_1] -- cookie use enabled',
$balancer).'';
}
- if (keys(%toupdate)) {
- my %thismachine;
- my $updatedhere;
- my $cachetime = 60*60*24;
- map { $thismachine{$_} = 1; } &Apache::lonnet::current_machine_ids();
- foreach my $lonhost (keys(%toupdate)) {
- if ($thismachine{$lonhost}) {
- unless ($updatedhere) {
- &Apache::lonnet::do_cache_new('loadbalancing',$dom,
- $defaultshash{'loadbalancing'},
- $cachetime);
- $updatedhere = 1;
- }
- } else {
- my $cachekey = &escape('loadbalancing').':'.&escape($dom);
- &Apache::lonnet::remote_devalidate_cache($lonhost,[$cachekey]);
- }
+ }
+ }
+ if (keys(%toupdate)) {
+ my %thismachine;
+ my $updatedhere;
+ my $cachetime = 60*60*24;
+ map { $thismachine{$_} = 1; } &Apache::lonnet::current_machine_ids();
+ foreach my $lonhost (keys(%toupdate)) {
+ if ($thismachine{$lonhost}) {
+ unless ($updatedhere) {
+ &Apache::lonnet::do_cache_new('loadbalancing',$dom,
+ $defaultshash{'loadbalancing'},
+ $cachetime);
+ $updatedhere = 1;
}
+ } else {
+ my $cachekey = &escape('loadbalancing').':'.&escape($dom);
+ &Apache::lonnet::remote_devalidate_cache($lonhost,[$cachekey]);
}
}
}
| |