From 61f73820621d4ea17ecde3c8d6872e6ce8f9eb12 Mon Sep 17 00:00:00 2001 From: Till Brehm <tbrehm@ispconfig.org> Date: Tue, 28 Oct 2014 04:35:30 -0400 Subject: [PATCH] - Changed tform_actions.inc.php to always provide oldDataRecord array for updates even when dbhistory = off. --- interface/lib/classes/validate_password.inc.php | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/interface/lib/classes/validate_password.inc.php b/interface/lib/classes/validate_password.inc.php index 543a90e..da044c6 100644 --- a/interface/lib/classes/validate_password.inc.php +++ b/interface/lib/classes/validate_password.inc.php @@ -38,19 +38,28 @@ return 1; } + $different = 0; + if (preg_match('/[abcdefghijklnmopqrstuvwxyz]/', $password)) { + $different += 1; + } + if (preg_match('/[ABCDEFGHIJKLNMOPQRSTUVWXYZ]/', $password)) { $points += 1; + $different += 1; } if (preg_match('/[0123456789]/', $password)) { $points += 1; + $different += 1; } - if (preg_match('/[`~!@#$%^&*()_+|\\=-[]}{\';:\/?.>,<" ]/', $password)) { + if (preg_match('/[`~!@#$%^&*()_+|\\=-\[\]}{\';:\/?.>,<" ]/', $password)) { $points += 1; + $different += 1; } + - if ($points == 0) { + if ($points == 0 || $different < 3) { if ($length >= 5 && $length <= 6) { return 1; } else if ($length >= 7 && $length <= 8) { @@ -114,7 +123,7 @@ $lng_text = str_replace('{chars}', $min_password_length, $lng_text); } if(!$lng_text) $lng_text = 'weak_password_txt'; // always return a string, even if language is missing - otherwise validator is NOT MATCHING! - + if(strlen($field_value) < $min_password_length) return $lng_text; if($this->_get_password_strength($field_value) < $min_password_strength) return $lng_text; -- Gitblit v1.9.1