From: Tim Düsterhus Date: Thu, 16 Jul 2020 12:33:54 +0000 (+0200) Subject: Remove register_password_* options in favor of password_min_score X-Git-Tag: 5.3.0_Alpha_1~76^2~10 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3e8428422cf3fec5ef463e597450e252e7588e47;p=GitHub%2FWoltLab%2FWCF.git Remove register_password_* options in favor of password_min_score see #3378 --- diff --git a/com.woltlab.wcf/option.xml b/com.woltlab.wcf/option.xml index 967d643ddd..a4db2a4d55 100644 --- a/com.woltlab.wcf/option.xml +++ b/com.woltlab.wcf/option.xml @@ -1166,36 +1166,12 @@ XING textarea - - - - - - @@ -1764,5 +1740,11 @@ DESC:wcf.global.sortOrder.descending diff --git a/constants.php b/constants.php index 7c526ea940..3c4b10db4d 100644 --- a/constants.php +++ b/constants.php @@ -142,11 +142,7 @@ define('IMAGE_PROXY_HOST_WHITELIST', ''); define('ENABLE_CENSORSHIP', 0); define('CENSORED_WORDS', ''); define('REGISTER_ENABLE_PASSWORD_SECURITY_CHECK', 0); -define('REGISTER_PASSWORD_MIN_LENGTH', 8); -define('REGISTER_PASSWORD_MUST_CONTAIN_LOWER_CASE', 1); -define('REGISTER_PASSWORD_MUST_CONTAIN_UPPER_CASE', 1); -define('REGISTER_PASSWORD_MUST_CONTAIN_DIGIT', 1); -define('REGISTER_PASSWORD_MUST_CONTAIN_SPECIAL_CHAR', 1); +define('PASSWORD_MIN_SCORE', 1); define('REGISTER_FORBIDDEN_USERNAMES', ''); define('REGISTER_FORBIDDEN_EMAILS', ''); define('REGISTER_ALLOWED_EMAILS', ''); diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index 683455934d..e003732463 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -376,6 +376,14 @@ class WCF { // https://github.com/WoltLab/WCF/issues/3330 define('MESSAGE_SIDEBAR_ENABLE_USER_ONLINE_MARKING', 1); + // Password strength configuration is deprecated since 5.3. + define('REGISTER_ENABLE_PASSWORD_SECURITY_CHECK', 0); + define('REGISTER_PASSWORD_MIN_LENGTH', 0); + define('REGISTER_PASSWORD_MUST_CONTAIN_LOWER_CASE', 8); + define('REGISTER_PASSWORD_MUST_CONTAIN_UPPER_CASE', 0); + define('REGISTER_PASSWORD_MUST_CONTAIN_DIGIT', 0); + define('REGISTER_PASSWORD_MUST_CONTAIN_SPECIAL_CHAR', 0); + $filename = WCF_DIR.'options.inc.php'; // create options file if doesn't exist diff --git a/wcfsetup/install/files/lib/util/UserRegistrationUtil.class.php b/wcfsetup/install/files/lib/util/UserRegistrationUtil.class.php index 4b11b064f2..9cdab3c8d6 100644 --- a/wcfsetup/install/files/lib/util/UserRegistrationUtil.class.php +++ b/wcfsetup/install/files/lib/util/UserRegistrationUtil.class.php @@ -69,21 +69,11 @@ final class UserRegistrationUtil { } /** - * Returns true if the given password is secure. + * Always returns true. * - * @param string $password - * @return boolean + * @deprecated 5.3 - Take a look at the zxcvbn verdict from WoltLabSuite/Core/Ui/User/PasswordStrength. */ public static function isSecurePassword($password) { - if (REGISTER_ENABLE_PASSWORD_SECURITY_CHECK) { - if (mb_strlen($password) < REGISTER_PASSWORD_MIN_LENGTH) return false; - - if (REGISTER_PASSWORD_MUST_CONTAIN_DIGIT && !preg_match('![0-9]+!', $password)) return false; - if (REGISTER_PASSWORD_MUST_CONTAIN_LOWER_CASE && !preg_match('![a-z]+!', $password)) return false; - if (REGISTER_PASSWORD_MUST_CONTAIN_UPPER_CASE && !preg_match('![A-Z]+!', $password)) return false; - if (REGISTER_PASSWORD_MUST_CONTAIN_SPECIAL_CHAR && !preg_match('![^A-Za-z0-9]+!', $password)) return false; - } - return true; } @@ -94,34 +84,7 @@ final class UserRegistrationUtil { * @return string */ public static function getPasswordRulesAttributeValue() { - if (REGISTER_ENABLE_PASSWORD_SECURITY_CHECK) { - $rules = ''; - - if (REGISTER_PASSWORD_MIN_LENGTH) { - $rules .= 'minlength:'.REGISTER_PASSWORD_MIN_LENGTH.';'; - } - - if (REGISTER_PASSWORD_MUST_CONTAIN_DIGIT) { - $rules .= 'required:digit;'; - } - - if (REGISTER_PASSWORD_MUST_CONTAIN_LOWER_CASE) { - $rules .= 'required:lower;'; - } - - if (REGISTER_PASSWORD_MUST_CONTAIN_UPPER_CASE) { - $rules .= 'required:upper;'; - } - - if (REGISTER_PASSWORD_MUST_CONTAIN_SPECIAL_CHAR) { - $rules .= 'required:special;'; - } - } - else { - $rules = "minlength:8;"; - } - - return $rules; + return "minlength:8;"; } /** diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index c29fe1b70e..b2872c2b9a 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -1468,13 +1468,11 @@ ACHTUNG: Die oben genannten Meldungen sind stark gekürzt. Sie können Details z - - - - - - - + + zxcvbn-Bibliothek, den Kennwörter mindestens erreichen müssen.]]> + + + @@ -4538,13 +4536,7 @@ Dateianhänge: - + @@ -4594,13 +4586,7 @@ dann wird diese Anfrage am {$mailbox->getUser()->lastLostPasswordRequestTime+864 - + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 6c7d81b8d8..74915c226c 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1447,13 +1447,11 @@ ATTENTION: The messages listed above are greatly shortened. You can view details - - - - - - - + + zxcvbn library that passwords need to achive.]]> + + + @@ -4539,12 +4537,7 @@ Attachments: - + @@ -4591,12 +4584,7 @@ the website {@PAGE_TITLE|language}. - +