version 1.355, 2019/04/26 20:15:30
|
version 1.356, 2019/04/26 20:22:18
|
Line 5822 sub print_passwords {
|
Line 5822 sub print_passwords {
|
max => 'Maximum password length', |
max => 'Maximum password length', |
chars => 'Required characters', |
chars => 'Required characters', |
expire => 'Password expiration (days)', |
expire => 'Password expiration (days)', |
|
numsaved => 'Number of previous passwords to save and disallow reuse', |
); |
); |
if ($position eq 'top') { |
if ($position eq 'top') { |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
Line 6085 sub print_passwords {
|
Line 6086 sub print_passwords {
|
$itemcount ++; |
$itemcount ++; |
} |
} |
} elsif ($position eq 'lower') { |
} elsif ($position eq 'lower') { |
my ($min,$max,%chars,$expire); |
my ($min,$max,%chars,$expire,$numsaved); |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if ($settings->{min}) { |
if ($settings->{min}) { |
$min = $settings->{min}; |
$min = $settings->{min}; |
Line 6099 sub print_passwords {
|
Line 6100 sub print_passwords {
|
if ($settings->{expire}) { |
if ($settings->{expire}) { |
$expire = $settings->{expire}; |
$expire = $settings->{expire}; |
} |
} |
|
if ($settings->(numsaved}) { |
|
$numsaved = $settings->(numsaved}; |
|
} |
} else { |
} else { |
$min = '7'; |
$min = '7'; |
} |
} |
Line 6161 sub print_passwords {
|
Line 6165 sub print_passwords {
|
'<input type="text" name="passwords_expire" value="'.$expire.'" size="4" />'. |
'<input type="text" name="passwords_expire" value="'.$expire.'" size="4" />'. |
'<span class="LC_fontsize_small"> '.&mt('(Leave blank for no expiration)').'</span>'. |
'<span class="LC_fontsize_small"> '.&mt('(Leave blank for no expiration)').'</span>'. |
'</span></td></tr>'; |
'</span></td></tr>'; |
|
$itemcount ++; |
|
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
|
$datatable .= '<tr'.$css_class.'><td>'.$titles{'numsaved'}.'</td>'. |
|
'<td class="LC_left_item"><span class="LC_nobreak">'. |
|
'<input type="text" name="passwords_numsaved" value="'.$numsaved.'" size="3" />'. |
|
'<span class="LC_fontsize_small"> '.&mt('(Leave blank to not save previous passwords)').'</span>'. |
|
'</span></td></tr>'; |
} else { |
} else { |
my $checkedon; |
my $checkedon; |
my $checkedoff = ' checked="checked"'; |
my $checkedoff = ' checked="checked"'; |
Line 13984 sub modify_passwords {
|
Line 13995 sub modify_passwords {
|
max => 'Maximum password length', |
max => 'Maximum password length', |
chars => 'Required characters', |
chars => 'Required characters', |
expire => 'Password expiration (days)', |
expire => 'Password expiration (days)', |
|
numsaved => 'Number of previous passwords to save', |
reset => 'Resetting Forgotten Password', |
reset => 'Resetting Forgotten Password', |
intauth => 'Encryption of Stored Passwords (Internal Auth)', |
intauth => 'Encryption of Stored Passwords (Internal Auth)', |
rules => 'Rules for LON-CAPA Passwords', |
rules => 'Rules for LON-CAPA Passwords', |
Line 14191 sub modify_passwords {
|
Line 14203 sub modify_passwords {
|
$updatedefaults = 1; |
$updatedefaults = 1; |
} |
} |
} |
} |
foreach my $rule ('min','max','expire') { |
foreach my $rule ('min','max','expire','numsaved') { |
$env{'form.passwords_'.$rule} =~ s/^\s+|\s+$//g; |
$env{'form.passwords_'.$rule} =~ s/^\s+|\s+$//g; |
if ($env{'form.passwords_'.$rule} =~ /^(|\d+(|\.\d*))$/) { |
my $ruleok; |
|
if ($rule eq 'expire') { |
|
if ($env{'form.passwords_'.$rule} =~ /^\d+(|\.\d*)$/) { |
|
$ruleok = 1; |
|
} |
|
} elsif ($env{'form.passwords_'.$rule} =~ /^\d+$/) { |
|
$ruleok = 1; |
|
} |
|
if ($ruleok) { |
$newvalues{$rule} = $env{'form.passwords_'.$rule}; |
$newvalues{$rule} = $env{'form.passwords_'.$rule}; |
if (exists($current{$rule})) { |
if (exists($current{$rule})) { |
if ($newvalues{$rule} ne $current{$rule}) { |
if ($newvalues{$rule} ne $current{$rule}) { |
Line 14373 sub modify_passwords {
|
Line 14393 sub modify_passwords {
|
$resulttext .= '<li>'.&mt('[_1] set to "[_2]"',$titles{$key.'_'.$item},$value).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] set to "[_2]"',$titles{$key.'_'.$item},$value).'</li>'; |
} |
} |
} elsif ($key eq 'rules') { |
} elsif ($key eq 'rules') { |
foreach my $rule ('min','max','expire') { |
foreach my $rule ('min','max','expire','numsaved') { |
if ($confighash{'passwords'}{$rule} eq '') { |
if ($confighash{'passwords'}{$rule} eq '') { |
$resulttext .= '<li>'.&mt('[_1] not set.',$titles{$rule}); |
|
if ($rule eq 'min') { |
if ($rule eq 'min') { |
$resulttext .= ' '.&mt('Default of 7 will be used'); |
$resulttext .= '<li>'.&mt('[_1] not set.',$titles{$rule}); |
|
' '.&mt('Default of 7 will be used').'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('[_1] set to none',$titles{$rule}).'</li>'; |
} |
} |
$resulttext .= '</li>'; |
|
} else { |
} else { |
$resulttext .= '<li>'.&mt('[_1] set to [_2]',$titles{$rule},$confighash{'passwords'}{$rule}).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] set to [_2]',$titles{$rule},$confighash{'passwords'}{$rule}).'</li>'; |
} |
} |