--- loncom/interface/loncommon.pm 2019/05/05 23:19:47 1.1331 +++ loncom/interface/loncommon.pm 2019/11/20 22:53:32 1.1334 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1331 2019/05/05 23:19:47 raeburn Exp $ +# $Id: loncommon.pm,v 1.1334 2019/11/20 22:53:32 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3571,16 +3571,17 @@ sub check_passwd_rules { my ($domain,$plainpass) = @_; my %passwdconf = &Apache::lonnet::get_passwdconf($domain); my ($min,$max,@chars,@brokerule,$warning); + $min = $Apache::lonnet::passwdmin; if (ref($passwdconf{'chars'}) eq 'ARRAY') { if ($passwdconf{'min'} =~ /^\d+$/) { - $min = $passwdconf{'min'}; + if ($passwdconf{'min'} > $min) { + $min = $passwdconf{'min'}; + } } if ($passwdconf{'max'} =~ /^\d+$/) { $max = $passwdconf{'max'}; } @chars = @{$passwdconf{'chars'}}; - } else { - $min = 7; } if (($min) && (length($plainpass) < $min)) { push(@brokerule,'min'); @@ -3597,7 +3598,7 @@ sub check_passwd_rules { } } if ($rules{'lc'}) { - unless ($plainpass =~ /a-z/) { + unless ($plainpass =~ /[a-z]/) { push(@brokerule,'lc'); } } @@ -3633,6 +3634,9 @@ sub check_passwd_rules { } $warning .= ''; } + if (wantarray) { + return @brokerule; + } return $warning; } @@ -7254,7 +7258,8 @@ table.LC_prior_tries td { padding: 6px; } -.LC_answer_unknown { +.LC_answer_unknown, +.LC_answer_warning { background: orange; color: black; padding: 6px;