version 1.1331, 2019/05/05 23:19:47
|
version 1.1333, 2019/08/25 02:42:56
|
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 3633 sub check_passwd_rules {
|
Line 3634 sub check_passwd_rules {
|
} |
} |
$warning .= '</ul>'; |
$warning .= '</ul>'; |
} |
} |
|
if (wantarray) { |
|
return @brokerule; |
|
} |
return $warning; |
return $warning; |
} |
} |
|
|