--- loncom/interface/domainprefs.pm 2021/04/29 17:45:22 1.382
+++ loncom/interface/domainprefs.pm 2021/09/01 00:21:52 1.385
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.382 2021/04/29 17:45:22 raeburn Exp $
+# $Id: domainprefs.pm,v 1.385 2021/09/01 00:21:52 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -223,7 +223,7 @@ sub handler {
'ltitools','ssl','trust','lti','privacy','passwords',
'proctoring','wafproxy'],$dom);
my %encconfig =
- &Apache::lonnet::get_dom('encconfig',['ltitools','lti','proctoring'],$dom);
+ &Apache::lonnet::get_dom('encconfig',['ltitools','lti','proctoring'],$dom,undef,1);
if (ref($domconfig{'ltitools'}) eq 'HASH') {
if (ref($encconfig{'ltitools'}) eq 'HASH') {
foreach my $id (keys(%{$domconfig{'ltitools'}})) {
@@ -857,6 +857,8 @@ sub print_config_box {
$output .= &proctoring_javascript($settings);
} elsif ($action eq 'wafproxy') {
$output .= &wafproxy_javascript($dom);
+ } elsif ($action eq 'autoupdate') {
+ $output .= &autoupdate_javascript();
}
$output .=
'
@@ -3311,6 +3313,41 @@ function toggleLTI(form,setting,item) {
ENDSCRIPT
}
+sub autoupdate_javascript {
+ return <<"ENDSCRIPT";
+
+
+ENDSCRIPT
+}
+
sub print_autoenroll {
my ($dom,$settings,$rowtotal) = @_;
my $autorun = &Apache::lonnet::auto_run(undef,$dom),
@@ -3397,42 +3434,69 @@ sub print_autoenroll {
sub print_autoupdate {
my ($position,$dom,$settings,$rowtotal) = @_;
- my $datatable;
+ my ($enable,$datatable);
if ($position eq 'top') {
+ my %choices = &Apache::lonlocal::texthash (
+ run => 'Auto-update active?',
+ classlists => 'Update information in classlists?',
+ unexpired => 'Skip updates for users without active or future roles?',
+ lastactive => 'Skip updates for inactive users?',
+ );
+ my $itemcount = 0;
my $updateon = ' ';
my $updateoff = ' checked="checked" ';
- my $classlistson = ' ';
- my $classlistsoff = ' checked="checked" ';
if (ref($settings) eq 'HASH') {
if ($settings->{'run'} eq '1') {
$updateon = $updateoff;
$updateoff = ' ';
}
- if ($settings->{'classlists'} eq '1') {
- $classlistson = $classlistsoff;
- $classlistsoff = ' ';
- }
}
- my %title = (
- run => 'Auto-update active?',
- classlists => 'Update information in classlists?',
- );
- $datatable = ''.
- ''.&mt($title{'run'}).' | '.
- ' |
';
+ $datatable .= '';
+ if ($firstval eq 'no') {
+ $datatable .=
+ ''.&mt('No').
+ ' '.&mt('Yes').'';
+ } else {
+ $datatable .=
+ ''.&mt('Yes').
+ ' '.&mt('No').'';
+ }
+ $datatable .= ''.$additional.'';
$itemcount ++;
}
return ($datatable,$itemcount);
@@ -7337,12 +7407,10 @@ sub print_wafproxy {
foreach my $domain (keys(%otherdoms)) {
%{$values{$domain}} = ();
my %config = &Apache::lonnet::get_dom('configuration',['wafproxy'],$domain);
- if (ref($config{$domain}) eq 'HASH') {
- if (ref($config{$domain}{'wafproxy'}) eq 'HASH') {
- $aliases{$domain} = $config{$domain}{'wafproxy'}{'alias'};
- foreach my $item ('remoteip','ipheader','trusted','vpnint','vpnext') {
- $values{$domain}{$item} = $config{$domain}{'wafproxy'}{$item};
- }
+ if (ref($config{'wafproxy'}) eq 'HASH') {
+ $aliases{$domain} = $config{'wafproxy'}{'alias'};
+ foreach my $item ('remoteip','ipheader','trusted','vpnint','vpnext') {
+ $values{$domain}{$item} = $config{'wafproxy'}{$item};
}
}
}
@@ -7354,22 +7422,25 @@ sub print_wafproxy {
$itemcount ++;
my $dom_in_effect;
my $aliasrows = ''.
- ''.&mt('Hostname').': '.
- &Apache::lonnet::hostname($server).' | ';
+ ''.
+ &mt('Hostname').': '.
+ ''.&Apache::lonnet::hostname($server).' | | ';
if ($othercontrol{$server}) {
$dom_in_effect = $othercontrol{$server};
my $current;
- if (ref($aliases{$othercontrol{$server}}) eq 'HASH') {
- $current = $aliases{$othercontrol{$server}{$server}};
+ if (ref($aliases{$dom_in_effect}) eq 'HASH') {
+ $current = $aliases{$dom_in_effect}{$server};
}
+ $aliasrows .= ''.
+ &mt('Alias').': ';
if ($current) {
$aliasrows .= $current;
} else {
- $aliasrows .= &mt('None in effect');
+ $aliasrows .= &mt('None');
}
- $aliasrows .= ' | ('.
- &mt('WAF/Reverse Proxy controlled by domain: [_1]',
- ''.$othercontrol{$server}.'').' | ';
+ $aliasrows .= ' ('.
+ &mt('controlled by domain: [_1]',
+ ''.$dom_in_effect.'').')';
} else {
$dom_in_effect = $dom;
my $current;
@@ -7378,7 +7449,8 @@ sub print_wafproxy {
$current = $aliases{$dom}{$server};
}
}
- $aliasrows .= ''.&mt('WAF/Reverse Proxy Alias').': '.
+ $aliasrows .= ' | '.
+ &mt('Alias').': '.
' | ';
}
@@ -7408,17 +7480,18 @@ sub print_wafproxy {
'
';
$itemcount++;
}
- if (keys(%othercontrol)) {
- foreach my $key (sort(keys(%othercontrol))) {
+ if (keys(%otherdoms)) {
+ foreach my $key (sort(keys(%otherdoms))) {
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
- $datatable = ''.
- ''.&mt('Domain: [_1]',''.$key.'').' | '.
- ' |
';
+ $datatable .= ''.
+ ''.&mt('Domain: [_1]',''.$key.'').' | '.
+ ' |
';
$itemcount++;
}
}
} else {
+ my %ip_methods = &remoteip_methods();
if ($setdom) {
$itemcount ++;
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
@@ -7467,7 +7540,6 @@ sub print_wafproxy {
''.
''.$lt{'remoteip'}.': '.
' |