version 1.1331, 2019/05/05 23:19:47
|
version 1.1336, 2020/02/05 21:48:05
|
Line 3571 sub check_passwd_rules {
|
Line 3571 sub check_passwd_rules {
|
my ($domain,$plainpass) = @_; |
my ($domain,$plainpass) = @_; |
my %passwdconf = &Apache::lonnet::get_passwdconf($domain); |
my %passwdconf = &Apache::lonnet::get_passwdconf($domain); |
my ($min,$max,@chars,@brokerule,$warning); |
my ($min,$max,@chars,@brokerule,$warning); |
|
$min = $Apache::lonnet::passwdmin; |
if (ref($passwdconf{'chars'}) eq 'ARRAY') { |
if (ref($passwdconf{'chars'}) eq 'ARRAY') { |
if ($passwdconf{'min'} =~ /^\d+$/) { |
if ($passwdconf{'min'} =~ /^\d+$/) { |
$min = $passwdconf{'min'}; |
if ($passwdconf{'min'} > $min) { |
|
$min = $passwdconf{'min'}; |
|
} |
} |
} |
if ($passwdconf{'max'} =~ /^\d+$/) { |
if ($passwdconf{'max'} =~ /^\d+$/) { |
$max = $passwdconf{'max'}; |
$max = $passwdconf{'max'}; |
} |
} |
@chars = @{$passwdconf{'chars'}}; |
@chars = @{$passwdconf{'chars'}}; |
} else { |
|
$min = 7; |
|
} |
} |
if (($min) && (length($plainpass) < $min)) { |
if (($min) && (length($plainpass) < $min)) { |
push(@brokerule,'min'); |
push(@brokerule,'min'); |
Line 3597 sub check_passwd_rules {
|
Line 3598 sub check_passwd_rules {
|
} |
} |
} |
} |
if ($rules{'lc'}) { |
if ($rules{'lc'}) { |
unless ($plainpass =~ /a-z/) { |
unless ($plainpass =~ /[a-z]/) { |
push(@brokerule,'lc'); |
push(@brokerule,'lc'); |
} |
} |
} |
} |
Line 3626 sub check_passwd_rules {
|
Line 3627 sub check_passwd_rules {
|
$rulenames{'min'} = &mt('Minimum password length: [_1]',$min); |
$rulenames{'min'} = &mt('Minimum password length: [_1]',$min); |
$rulenames{'max'} = &mt('Maximum password length: [_1]',$max); |
$rulenames{'max'} = &mt('Maximum password length: [_1]',$max); |
$warning = &mt('Password did not satisfy the following:').'<ul>'; |
$warning = &mt('Password did not satisfy the following:').'<ul>'; |
foreach my $rule ('min','max','uc','ls','num','spec') { |
foreach my $rule ('min','max','uc','lc','num','spec') { |
if (grep(/^$rule$/,@brokerule)) { |
if (grep(/^$rule$/,@brokerule)) { |
$warning .= '<li>'.$rulenames{$rule}.'</li>'; |
$warning .= '<li>'.$rulenames{$rule}.'</li>'; |
} |
} |
} |
} |
$warning .= '</ul>'; |
$warning .= '</ul>'; |
} |
} |
|
if (wantarray) { |
|
return @brokerule; |
|
} |
return $warning; |
return $warning; |
} |
} |
|
|
Line 7254 table.LC_prior_tries td {
|
Line 7258 table.LC_prior_tries td {
|
padding: 6px; |
padding: 6px; |
} |
} |
|
|
.LC_answer_unknown { |
.LC_answer_unknown, |
|
.LC_answer_warning { |
background: orange; |
background: orange; |
color: black; |
color: black; |
padding: 6px; |
padding: 6px; |
Line 8250 ul.LC_funclist li {
|
Line 8255 ul.LC_funclist li {
|
cursor:pointer; |
cursor:pointer; |
} |
} |
|
|
|
pre.LC_wordwrap { |
|
white-space: pre-wrap; |
|
white-space: -moz-pre-wrap; |
|
white-space: -pre-wrap; |
|
white-space: -o-pre-wrap; |
|
word-wrap: break-word; |
|
} |
|
|
/* |
/* |
styles used for response display |
styles used for response display |
*/ |
*/ |
Line 9006 sub modal_link {
|
Line 9019 sub modal_link {
|
$target_attr = 'target="'.$target.'"'; |
$target_attr = 'target="'.$target.'"'; |
} |
} |
return <<"ENDLINK"; |
return <<"ENDLINK"; |
<a href="$link" $target_attr title="$title" onclick="javascript:openMyModal('$link',$width,$height,'$scrolling','$transparency','$style'); return false;"> |
<a href="$link" $target_attr title="$title" onclick="javascript:openMyModal('$link',$width,$height,'$scrolling','$transparency','$style'); return false;">$linktext</a> |
$linktext</a> |
|
ENDLINK |
ENDLINK |
} |
} |
|
|