--- loncom/interface/domainprefs.pm 2020/02/04 18:51:20 1.160.6.102.2.2
+++ loncom/interface/domainprefs.pm 2020/07/18 20:28:24 1.160.6.102.2.4
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.160.6.102.2.2 2020/02/04 18:51:20 raeburn Exp $
+# $Id: domainprefs.pm,v 1.160.6.102.2.4 2020/07/18 20:28:24 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -742,6 +742,7 @@ sub print_config_box {
if ($numheaders > 1) {
my $colspan = '';
my $rightcolspan = '';
+ my $leftnobr = '';
if (($action eq 'rolecolors') || ($action eq 'defaults') ||
($action eq 'directorysrch') ||
(($action eq 'login') && ($numheaders < 4))) {
@@ -750,12 +751,15 @@ sub print_config_box {
if ($action eq 'usersessions') {
$rightcolspan = ' colspan="3"';
}
+ if ($action eq 'passwords') {
+ $leftnobr = ' LC_nobreak';
+ }
$output .= '
-
'.&mt($item->{'header'}->[0]->{'col1'}).'
+
'.&mt($item->{'header'}->[0]->{'col1'}).'
'.&mt($item->{'header'}->[0]->{'col2'}).'
';
$rowtotal ++;
@@ -814,7 +818,7 @@ sub print_config_box {
-
'.&mt($item->{'header'}->[2]->{'col1'}).'
+
'.&mt($item->{'header'}->[2]->{'col1'}).'
'.&mt($item->{'header'}->[2]->{'col2'}).'
'."\n";
if ($action eq 'coursecategories') {
@@ -4759,7 +4763,7 @@ sub print_passwords {
$datatable .= ''.
- ' ';
+ ' ';
}
}
my $checkedcase;
@@ -4863,7 +4867,7 @@ sub print_passwords {
&mt('(If you use the same account ... reset a password from this page.)').'
'.
&mt('Include custom text:');
if ($customurl) {
- my $link = &Apache::loncommon::modal_link($customurl,&mt('Custom text file'),600,500,
+ my $link = &Apache::loncommon::modal_link($customurl,&mt('custom text'),600,500,
undef,undef,undef,undef,'background-color:#ffffff');
$datatable .= ' '.$link.
''.
- ' ';
+ ' ';
}
}
my $checked;
@@ -5109,13 +5113,18 @@ sub print_usersessions {
if ($position eq 'top') {
if (keys(%serverhomes) > 1) {
my %spareid = ¤t_offloads_to($dom,$settings,\%servers);
- my $curroffloadnow;
+ my ($curroffloadnow,$curroffloadoth);
if (ref($settings) eq 'HASH') {
if (ref($settings->{'offloadnow'}) eq 'HASH') {
$curroffloadnow = $settings->{'offloadnow'};
}
+ if (ref($settings->{'offloadoth'}) eq 'HASH') {
+ $curroffloadoth = $settings->{'offloadoth'};
+ }
}
- $datatable .= &spares_row($dom,\%servers,\%spareid,\%serverhomes,\%altids,$curroffloadnow,$rowtotal);
+ my $other_insts = scalar(keys(%by_location));
+ $datatable .= &spares_row($dom,\%servers,\%spareid,\%serverhomes,\%altids,
+ $other_insts,$curroffloadnow,$curroffloadoth,$rowtotal);
} else {
$datatable .= '
'.
&mt('Nothing to set here, as the cluster to which this domain belongs only contains one server.');
@@ -5365,7 +5374,8 @@ sub current_offloads_to {
}
sub spares_row {
- my ($dom,$servers,$spareid,$serverhomes,$altids,$curroffloadnow,$rowtotal) = @_;
+ my ($dom,$servers,$spareid,$serverhomes,$altids,$other_insts,
+ $curroffloadnow,$curroffloadoth,$rowtotal) = @_;
my $css_class;
my $numinrow = 4;
my $itemcount = 1;
@@ -5385,12 +5395,17 @@ sub spares_row {
}
}
next unless (ref($spareid->{$server}) eq 'HASH');
- my $checkednow;
+ my ($checkednow,$checkedoth);
if (ref($curroffloadnow) eq 'HASH') {
if ($curroffloadnow->{$server}) {
$checkednow = ' checked="checked"';
}
}
+ if (ref($curroffloadoth) eq 'HASH') {
+ if ($curroffloadoth->{$server}) {
+ $checkedoth = ' checked="checked"';
+ }
+ }
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
$datatable .= '
@@ -5399,8 +5414,15 @@ sub spares_row {
,''.$server.'').' '.
''."\n".
''.
+ ' '.&mt('Switch any active user on next access').''.
+ "\n";
+ if ($other_insts) {
+ $datatable .= ' '.
+ ''."\n".
+ ''.
"\n";
+ }
my (%current,%canselect);
my @choices =
&possible_newspares($server,$spareid->{$server},$serverhomes,$altids);
@@ -7830,8 +7852,8 @@ function warnIntPass(field) {
alert('$intalert{passnum}');
}
}
+ field.value = '';
}
- field.value = '';
}
}
}
@@ -12174,6 +12196,8 @@ sub modify_passwords {
if ($staticdefaults{$rule} ne $newvalues{$rule}) {
$changes{'rules'} = 1;
}
+ } else {
+ $changes{'rules'} = 1;
}
} elsif (exists($current{$rule})) {
$changes{'rules'} = 1;
@@ -12252,9 +12276,11 @@ sub modify_passwords {
$resulttext .= '
'.&mt('CAPTCHA validation set to use: original CAPTCHA').'
'.&mt('[_1] set to [_2]',$titles{$rule},$confighash{'passwords'}{$rule}).'
';
}
}
+ if (ref($confighash{'passwords'}{'chars'}) eq 'ARRAY') {
+ if (@{$confighash{'passwords'}{'chars'}} > 0) {
+ my %rulenames = &Apache::lonlocal::texthash(
+ uc => 'At least one upper case letter',
+ lc => 'At least one lower case letter',
+ num => 'At least one number',
+ spec => 'At least one non-alphanumeric',
+ );
+ my $needed = '