[LON-CAPA-cvs] cvs: loncom /interface domainprefs.pm
raeburn
raeburn at source.lon-capa.org
Sat Dec 8 10:03:26 EST 2018
raeburn Sat Dec 8 15:03:26 2018 EDT
Modified files:
/loncom/interface domainprefs.pm
Log:
- Appropriate feedback when ssl, trust or session hosting configuration is
changed to "not in use".
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.343 loncom/interface/domainprefs.pm:1.344
--- loncom/interface/domainprefs.pm:1.343 Wed Dec 5 21:13:23 2018
+++ loncom/interface/domainprefs.pm Sat Dec 8 15:03:25 2018
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.343 2018/12/05 21:13:23 raeburn Exp $
+# $Id: domainprefs.pm,v 1.344 2018/12/08 15:03:25 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -16642,14 +16642,18 @@
} else {
foreach my $type (@{$types{$prefix}}) {
if (defined($changes{$prefix}{$type})) {
- my $newvalue;
+ my ($newvalue,$notinuse);
if (ref($defaultshash{'usersessions'}) eq 'HASH') {
if (ref($defaultshash{'usersessions'}{$prefix})) {
if ($type eq 'version') {
$newvalue = $defaultshash{'usersessions'}{$prefix}{$type};
- } elsif (ref($defaultshash{'usersessions'}{$prefix}{$type}) eq 'ARRAY') {
- if (@{$defaultshash{'usersessions'}{$prefix}{$type}} > 0) {
- $newvalue = join(', ',@{$defaultshash{'usersessions'}{$prefix}{$type}});
+ } else {
+ if (ref($defaultshash{'usersessions'}{$prefix}{$type}) eq 'ARRAY') {
+ if (@{$defaultshash{'usersessions'}{$prefix}{$type}} > 0) {
+ $newvalue = join(', ',@{$defaultshash{'usersessions'}{$prefix}{$type}});
+ }
+ } else {
+ $notinuse = 1;
}
}
}
@@ -16657,12 +16661,14 @@
if ($newvalue eq '') {
if ($type eq 'version') {
$resulttext .= '<li>'.&mt('[_1] set to: off',$lt{$type}).'</li>';
+ } elsif ($notinuse) {
+ $resulttext .= '<li>'.&mt('[_1] set to: not in use',$lt{$type}).'</li>';
} else {
$resulttext .= '<li>'.&mt('[_1] set to: none',$lt{$type}).'</li>';
}
} else {
if ($type eq 'version') {
- $newvalue .= ' '.&mt('(or later)');
+ $newvalue .= ' '.&mt('(or later)');
}
$resulttext .= '<li>'.&mt('[_1] set to: [_2].',$lt{$type},$newvalue).'</li>';
}
@@ -16850,18 +16856,24 @@
$resulttext .= '<li>'.$titles{$prefix}.'<ul>';
foreach my $type (@{$types{$prefix}}) {
if (defined($changes{$prefix}{$type})) {
- my $newvalue;
+ my ($newvalue,$notinuse);
if (ref($defaultshash{$action}) eq 'HASH') {
if (ref($defaultshash{$action}{$prefix})) {
if (($prefix eq 'connto') || ($prefix eq 'connfrom')) {
$newvalue = $titles{$defaultshash{$action}{$prefix}{$type}};
- } elsif (ref($defaultshash{$action}{$prefix}{$type}) eq 'ARRAY') {
- if (@{$defaultshash{$action}{$prefix}{$type}} > 0) {
- $newvalue = join(', ',@{$defaultshash{$action}{$prefix}{$type}});
+ } else {
+ if (ref($defaultshash{$action}{$prefix}{$type}) eq 'ARRAY') {
+ if (@{$defaultshash{$action}{$prefix}{$type}} > 0) {
+ $newvalue = join(', ',@{$defaultshash{$action}{$prefix}{$type}});
+ }
+ } else {
+ $notinuse = 1;
}
}
}
- if ($newvalue eq '') {
+ if ($notinuse) {
+ $resulttext .= '<li>'.&mt('[_1] set to: not in use',$titles{$type}).'</li>';
+ } elsif ($newvalue eq '') {
$resulttext .= '<li>'.&mt('[_1] set to: none',$titles{$type}).'</li>';
} else {
$resulttext .= '<li>'.&mt('[_1] set to: [_2].',$titles{$type},$newvalue).'</li>';
@@ -16975,17 +16987,21 @@
$resulttext .= '<li>'.$lt{$prefix}.'<ul>';
foreach my $type (@types) {
if (defined($changes{$prefix}{$type})) {
- my $newvalue;
+ my ($newvalue,$notinuse);
if (ref($defaultshash{'trust'}) eq 'HASH') {
if (ref($defaultshash{'trust'}{$prefix})) {
if (ref($defaultshash{'trust'}{$prefix}{$type}) eq 'ARRAY') {
if (@{$defaultshash{'trust'}{$prefix}{$type}} > 0) {
$newvalue = join(', ',@{$defaultshash{'trust'}{$prefix}{$type}});
}
+ } else {
+ $notinuse = 1;
}
}
}
- if ($newvalue eq '') {
+ if ($notinuse) {
+ $resulttext .= '<li>'.&mt('[_1] set to: not in use',$lt{$type}).'</li>';
+ } elsif ($newvalue eq '') {
$resulttext .= '<li>'.&mt('[_1] set to: none',$lt{$type}).'</li>';
} else {
$resulttext .= '<li>'.&mt('[_1] set to: [_2].',$lt{$type},$newvalue).'</li>';
More information about the LON-CAPA-cvs
mailing list