MDL-26564 fix reversed password policy check

This commit is contained in:
Petr Skoda
2011-03-01 17:22:00 +01:00
parent 8bdb31ed54
commit faceca9176
+2 -2
View File
@@ -538,7 +538,7 @@ if ($formdata = $mform2->is_cancelled()) {
} else if (!empty($user->password)) {
if ($updatepasswords) {
$errmsg = null;
$weak = check_password_policy($user->password, $errmsg);
$weak = !check_password_policy($user->password, $errmsg);
if ($resetpasswords == UU_PWRESET_ALL or ($resetpasswords == UU_PWRESET_WEAK and $weak)) {
if ($weak) {
$weakpasswords++;
@@ -644,7 +644,7 @@ if ($formdata = $mform2->is_cancelled()) {
}
} else {
$errmsg = null;
$weak = check_password_policy($user->password, $errmsg);
$weak = !check_password_policy($user->password, $errmsg);
if ($resetpasswords == UU_PWRESET_ALL or ($resetpasswords == UU_PWRESET_WEAK and $weak)) {
if ($weak) {
$weakpasswords++;