Marius Cramer
2014-12-19 77cc4a99b15f4639b56c29a1207dc04b459c5d54
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) {
@@ -96,6 +105,8 @@
   function password_check($field_name, $field_value, $validator) {
      global $app;
      
      if($field_value == '') return false;
      $app->uses('ini_parser,getconf');
      $server_config_array = $app->getconf->get_global_config();
      
@@ -112,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;