mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
Add option for human-readable regexp description
This commit is contained in:
@@ -51,6 +51,7 @@ line5=Password restrictions,11
|
||||
passwd_min=Minimum password length,3,No minimum
|
||||
passwd_dict=Prevent dictionary word passwords?,1,1-Yes,0-No
|
||||
passwd_re=Perl regexp to check password against,3,None
|
||||
passwd_redesc=Human-readable description of regexp,3,Just use regexp
|
||||
passwd_same=Prevent passwords containing username?,1,1-Yes,0-No
|
||||
passwd_prog=External password-checking program,3,None
|
||||
passwd_progmode=Pass username and password to program,1,1-As input,0-As parameters
|
||||
|
||||
@@ -1531,8 +1531,9 @@ local ($pass, $username, $uinfo) = @_;
|
||||
return &text('usave_epasswd_min', $config{'passwd_min'})
|
||||
if (length($pass) < $config{'passwd_min'});
|
||||
local $re = $config{'passwd_re'};
|
||||
return &text('usave_epasswd_re', $re)
|
||||
if ($re && !eval { $pass =~ /^$re$/ });
|
||||
if ($re && !eval { $pass =~ /^$re$/ }) {
|
||||
return $config{'passwd_redesc'} || &text('usave_epasswd_re', $re);
|
||||
}
|
||||
if ($config{'passwd_same'}) {
|
||||
return &text('usave_epasswd_same') if ($pass =~ /\Q$username\E/i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user