More work on password quality restrictions

This commit is contained in:
Jamie Cameron
2007-09-13 06:33:54 +00:00
parent 7b53078f74
commit 77b6225ed6
2 changed files with 11 additions and 5 deletions

View File

@@ -14,6 +14,14 @@ if (!defined($oldtheme)) {
$oldtheme = $gconfig{'theme'};
}
# Validate the password
if ($access{'pass'} && &can_change_pass($user) && !$in{'pass_def'}) {
$in{'pass'} =~ /:/ && &error($text{'change_ecolon'});
$perr = &acl::check_password_restrictions(
$user->{'name'}, $in{'pass'});
&error(&text('change_epass', $perr)) if ($perr);
}
print "$text{'change_user'}<br>\n";
if ($access{'lang'}) {
if ($in{'lang_def'}) {
@@ -35,11 +43,8 @@ if ($access{'theme'}) {
$newtheme = $gconfig{'theme'};
}
}
if ($access{'pass'} && &can_change_pass($user)) {
if (!$in{'pass_def'}) {
$in{'pass'} =~ /:/ && &error($text{'change_ecolon'});
$user->{'pass'} = &acl::encrypt_password($in{'pass'});
}
if ($access{'pass'} && &can_change_pass($user) && !$in{'pass_def'}) {
$user->{'pass'} = &acl::encrypt_password($in{'pass'});
}
&acl::modify_user($user->{'name'}, $user);
print "$text{'change_done'}<p>\n";

View File

@@ -24,6 +24,7 @@ change_done=.. done
change_restart=Re-starting Webmin ..
change_redirect=Re-directing to main menu ..
change_ecolon=Your password cannot contain the : character
change_epass=New password is not valid : $1
acl_lang=Can change language?
acl_theme=Can change theme?