--- loncom/interface/domainprefs.pm 2020/12/23 21:39:23 1.374
+++ loncom/interface/domainprefs.pm 2021/03/06 13:39:54 1.380
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.374 2020/12/23 21:39:23 raeburn Exp $
+# $Id: domainprefs.pm,v 1.380 2021/03/06 13:39:54 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3781,18 +3781,17 @@ sub print_contacts {
\%choices,$rownum);
$datatable .= $reports;
} elsif ($position eq 'lower') {
- $css_class = $rownum%2?' class="LC_odd_row"':'';
- my ($threshold,$sysmail,%excluded,%weights);
+ my (%current,%excluded,%weights);
my ($defaults,$names) = &Apache::loncommon::lon_status_items();
if ($lonstatus{'threshold'} =~ /^\d+$/) {
- $threshold = $lonstatus{'threshold'};
+ $current{'errorthreshold'} = $lonstatus{'threshold'};
} else {
- $threshold = $defaults->{'threshold'};
+ $current{'errorthreshold'} = $defaults->{'threshold'};
}
if ($lonstatus{'sysmail'} =~ /^\d+$/) {
- $sysmail = $lonstatus{'sysmail'};
+ $current{'errorsysmail'} = $lonstatus{'sysmail'};
} else {
- $sysmail = $defaults->{'sysmail'};
+ $current{'errorsysmail'} = $defaults->{'sysmail'};
}
if (ref($lonstatus{'weights'}) eq 'HASH') {
foreach my $type ('E','W','N','U') {
@@ -3812,13 +3811,16 @@ sub print_contacts {
map {$excluded{$_} = 1; } @{$lonstatus{'excluded'}};
}
}
- $datatable .= '
'.
- ''.
- $titles->{'errorthreshold'}.
- ' | '.
- ' |
';
- $rownum ++;
+ foreach my $item ('errorthreshold','errorsysmail') {
+ $css_class = $rownum%2?' class="LC_odd_row"':'';
+ $datatable .= ''.
+ ''.
+ $titles->{$item}.
+ ' | '.
+ ' |
';
+ $rownum ++;
+ }
$css_class = $rownum%2?' class="LC_odd_row"':'';
$datatable .= ''.
''.
@@ -3864,14 +3866,6 @@ sub print_contacts {
}
$datatable .= ' |
';
$rownum ++;
- $css_class = $rownum%2?' class="LC_odd_row"':'';
- $datatable .= ''.
- ''.
- $titles->{'errorsysmail'}.
- ' | '.
- ' |
';
- $rownum ++;
} elsif ($position eq 'bottom') {
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);
my (@posstypes,%usertypeshash);
@@ -6161,7 +6155,7 @@ sub print_coursedefaults {
my $currcanclone = 'none';
my $onclick;
my @cloneoptions = ('none','domain');
- my %clonetitles = (
+ my %clonetitles = &Apache::lonlocal::texthash (
none => 'No additional course requesters',
domain => "Any course requester in course's domain",
instcode => 'Course requests for official courses ...',
@@ -7203,7 +7197,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};
}
}
@@ -7218,7 +7212,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 ('ipheader','trusted','exempt') {
+ foreach my $item ('ipheader','trusted','vpnint','vpnext') {
$values{$domain}{$item} = $config{$domain}{'wafproxy'}{$item};
}
}
@@ -7268,7 +7262,7 @@ sub print_wafproxy {
&mt('Format for comma separated IP blocks').':
'.
&mt('A.B.C.D/N or A.B.C.D - E.F.G.H').''.
'';
- foreach my $item ('ipheader','trusted','exempt') {
+ foreach my $item ('ipheader','trusted','vpnint','vpnext') {
$datatable .= ''.
''.$lt{$item}.': ';
if ($item eq 'ipheader') {
@@ -7290,7 +7284,7 @@ sub print_wafproxy {
$datatable .= ' | '.
''.&mt('Domain: [_1]',$domain).' | '.
'';
- foreach my $item ('ipheader','trusted','exempt') {
+ foreach my $item ('ipheader','trusted','vpnint','vpnext') {
my $showval = &mt('None');
if ($values{$domain}{$item}) {
$showval = $values{$domain}{$item};
@@ -7308,7 +7302,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',
);
@@ -8349,8 +8344,8 @@ sub contact_titles {
'updatesmail' => 'E-mail from nightly check of LON-CAPA module integrity/updates',
'idconflictsmail' => 'E-mail from bi-nightly check for multiple users sharing same student/employee ID',
'hostipmail' => 'E-mail from nightly check of hostname/IP network changes',
- 'errorthreshold' => 'Error/warning threshold for status e-mail',
- 'errorsysmail' => 'Error threshold for e-mail to core group',
+ 'errorthreshold' => 'Error count threshold for status e-mail to admin(s)',
+ 'errorsysmail' => 'Error count threshold for e-mail to developer group',
'errorweights' => 'Weights used to compute error count',
'errorexcluded' => 'Servers with unsent updates excluded from count',
);
@@ -9400,7 +9395,7 @@ sub print_defaults {
$datatable .= ' '.&mt('Internal ID:').' '.$item.' '.
''.
&mt('delete').''.
- ''.&mt('Name displayed:').
+ ' | '.&mt('Name displayed').':'.
''.
' | ';
}
@@ -9420,7 +9415,7 @@ sub print_defaults {
''.
' '.&mt('(new)').
''.
- &mt('Name displayed:').
+ &mt('Name displayed').':'.
' | '.
''."\n";
$rownum ++;
@@ -10429,7 +10424,7 @@ ENDSCRIPT
sub initialize_categories {
my ($itemcount) = @_;
my ($datatable,$css_class,$chgstr);
- my %default_names = (
+ my %default_names = &Apache::lonlocal::texthash (
instcode => 'Official courses (with institutional codes)',
communities => 'Communities',
placement => 'Placement Tests',
@@ -15204,7 +15199,7 @@ sub modify_contacts {
$contacts_hash{'contacts'}{'lonstatus'}{$item} = \@excluded;
}
} elsif ($item eq 'weights') {
- foreach my $type ('E','W','N') {
+ foreach my $type ('E','W','N','U') {
$env{'form.error'.$item.'_'.$type} =~ s/^\s+|\s+$//g;
if ($env{'form.error'.$item.'_'.$type} =~ /^\d+$/) {
unless ($env{'form.error'.$item.'_'.$type} == $lonstatus_defs->{$type}) {
@@ -16371,7 +16366,7 @@ sub modify_passwords {
$resulttext .= ''.&mt('E-mail address(es) in LON-CAPA used for verification will include: [_1]',join(', ',map { $titles{$_}; } @{$staticdefaults{'resetemail'}})).'';
}
} else {
- $resulttext .= ''.&mt('E-mail address(es) in LON-CAPA usedfor verification will include: [_1]',join(', ',map { $titles{$_}; } @{$staticdefaults{'resetemail'}})).'';
+ $resulttext .= ''.&mt('E-mail address(es) in LON-CAPA used for verification will include: [_1]',join(', ',map { $titles{$_}; } @{$staticdefaults{'resetemail'}})).'';
}
if ($confighash{'passwords'}{'resetremove'}) {
$resulttext .= ''.&mt('Preamble to "Forgot Password" web form not shown').'';
@@ -20721,24 +20716,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]);
}
}
}
| |