--- loncom/interface/loncommon.pm 2019/05/05 23:19:47 1.1331 +++ loncom/interface/loncommon.pm 2020/02/05 21:48:05 1.1336 @@ -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.1336 2020/02/05 21:48:05 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'); } } @@ -3626,13 +3627,16 @@ sub check_passwd_rules { $rulenames{'min'} = &mt('Minimum password length: [_1]',$min); $rulenames{'max'} = &mt('Maximum password length: [_1]',$max); $warning = &mt('Password did not satisfy the following:').''; } + 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; @@ -8250,6 +8255,14 @@ ul.LC_funclist li { 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 */ @@ -9006,8 +9019,7 @@ sub modal_link { $target_attr = 'target="'.$target.'"'; } return <<"ENDLINK"; - - $linktext +$linktext ENDLINK }