mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Not sure to understand the whole logic behind this :/ To me this should as simple as this ?
This commit is contained in:
parent
55256c1973
commit
167df05f56
2 changed files with 4 additions and 8 deletions
|
@ -329,14 +329,11 @@
|
||||||
"packages_no_upgrade": "There is no package to upgrade",
|
"packages_no_upgrade": "There is no package to upgrade",
|
||||||
"packages_upgrade_critical_later": "Critical packages ({packages:s}) will be upgraded later",
|
"packages_upgrade_critical_later": "Critical packages ({packages:s}) will be upgraded later",
|
||||||
"packages_upgrade_failed": "Unable to upgrade all of the packages",
|
"packages_upgrade_failed": "Unable to upgrade all of the packages",
|
||||||
|
"password_listed": "This password is among the most used password in the world. Please choose something a bit more unique.",
|
||||||
"password_too_simple_1": "Password needs to be at least 6 characters long",
|
"password_too_simple_1": "Password needs to be at least 6 characters long",
|
||||||
"password_too_simple_2": "Password needs to be at least 8 characters long and contains digit, upper and lower characters",
|
"password_too_simple_2": "Password needs to be at least 8 characters long and contains digit, upper and lower characters",
|
||||||
"password_too_simple_3": "Password needs to be at least 8 characters long and contains digit, upper, lower and special characters",
|
"password_too_simple_3": "Password needs to be at least 8 characters long and contains digit, upper, lower and special characters",
|
||||||
"password_too_simple_4": "Password needs to be at least 12 characters long and contains digit, upper, lower and special characters",
|
"password_too_simple_4": "Password needs to be at least 12 characters long and contains digit, upper, lower and special characters",
|
||||||
"password_listed_1": "This password is in a well known list. Please make it unique. Password needs to be at least 6 characters long",
|
|
||||||
"password_listed_2": "This password is in a well known list. Please make it unique. Password needs to be at least 8 characters long and contains digit, upper and lower characters",
|
|
||||||
"password_listed_3": "This password is in a well known list. Please make it unique. Password needs to be at least 8 characters long and contains digit, upper, lower and special characters",
|
|
||||||
"password_listed_4": "This password is in a well known list. Please make it unique. Password needs to be at least 12 characters long and contains digit, upper, lower and special characters",
|
|
||||||
"password_advice": "Advice: a good password is at least 8 characters and contains digit, upper, lower and special characters",
|
"password_advice": "Advice: a good password is at least 8 characters and contains digit, upper, lower and special characters",
|
||||||
"path_removal_failed": "Unable to remove path {:s}",
|
"path_removal_failed": "Unable to remove path {:s}",
|
||||||
"pattern_backup_archive_name": "Must be a valid filename with max 30 characters, and alphanumeric and -_. characters only",
|
"pattern_backup_archive_name": "Must be a valid filename with max 30 characters, and alphanumeric and -_. characters only",
|
||||||
|
|
|
@ -107,11 +107,10 @@ class PasswordValidator(object):
|
||||||
|
|
||||||
listed = password in SMALL_PWD_LIST or self.is_in_cracklib_list(password)
|
listed = password in SMALL_PWD_LIST or self.is_in_cracklib_list(password)
|
||||||
strength_level = self.strength_level(password)
|
strength_level = self.strength_level(password)
|
||||||
|
if listed:
|
||||||
|
return ("error", "password_listed")
|
||||||
if strength_level < self.validation_strength:
|
if strength_level < self.validation_strength:
|
||||||
if listed:
|
return ("error", "password_too_simple_%s" % self.validation_strength)
|
||||||
return ("error", "password_listed_" + str(self.validation_strength))
|
|
||||||
else:
|
|
||||||
return ("error", "password_too_simple_" + str(self.validation_strength))
|
|
||||||
|
|
||||||
if strength_level < 3:
|
if strength_level < 3:
|
||||||
return ("warning", 'password_advice')
|
return ("warning", 'password_advice')
|
||||||
|
|
Loading…
Add table
Reference in a new issue