[gnome-initial-setup] Revert "Revert "password: visibly warn the user when the password is bad""



commit 98c4adcc5c1ede68defbadfebd4b2aeb3a8589ce
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Wed Apr 11 22:31:09 2018 -0500

    Revert "Revert "password: visibly warn the user when the password is bad""
    
    This reverts commit 0c62c71b5754ded5557b759783084bdb7b40176b.
    
    With some changes to account for the fact that pw_strength() of 1 is
    considered weak now.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754213

 .../pages/password/gis-password-page.c             |    8 +++-
 gnome-initial-setup/pages/password/pw-utils.c      |   34 ++++++++++----------
 2 files changed, 23 insertions(+), 19 deletions(-)
---
diff --git a/gnome-initial-setup/pages/password/gis-password-page.c 
b/gnome-initial-setup/pages/password/gis-password-page.c
index 731666d..ea2415f 100644
--- a/gnome-initial-setup/pages/password/gis-password-page.c
+++ b/gnome-initial-setup/pages/password/gis-password-page.c
@@ -132,9 +132,13 @@ validate (GisPasswordPage *page)
   gtk_label_set_label (GTK_LABEL (priv->confirm_explanation), "");
   priv->valid_confirm = FALSE;
 
-  priv->valid_password = (strength_level > 1);
-  if (priv->valid_password)
+  priv->valid_password = (strlen (password) && strength_level > 1);
+  if (priv->valid_password) {
     set_entry_validation_checkmark (GTK_ENTRY (priv->password_entry));
+    clear_entry_validation_error (GTK_ENTRY (priv->password_entry));
+  } else {
+    set_entry_validation_error (GTK_ENTRY (priv->password_entry), _("This is a weak password."));
+  }
 
   if (strlen (password) > 0 && strlen (verify) > 0) {
     priv->valid_confirm = (strcmp (password, verify) == 0);
diff --git a/gnome-initial-setup/pages/password/pw-utils.c b/gnome-initial-setup/pages/password/pw-utils.c
index bc3f254..0913b07 100644
--- a/gnome-initial-setup/pages/password/pw-utils.c
+++ b/gnome-initial-setup/pages/password/pw-utils.c
@@ -80,39 +80,39 @@ pw_error_hint (gint error)
         case PWQ_ERROR_SAME_PASSWORD:
                 return C_("Password hint", "The new password needs to be different from the old one.");
         case PWQ_ERROR_CASE_CHANGES_ONLY:
-                return C_("Password hint", "Try changing some letters and numbers.");
+                return C_("Password hint", "This password is very similar to your last one. Try changing 
some letters and numbers.");
         case PWQ_ERROR_TOO_SIMILAR:
-                return C_("Password hint", "Try changing the password a bit more.");
+                return C_("Password hint", "This password is very similar to your last one. Try changing the 
password a bit more.");
         case PWQ_ERROR_USER_CHECK:
-                return C_("Password hint", "A password without your user name would be stronger.");
+                return C_("Password hint", "This is a weak password. A password without your user name would 
be stronger.");
         case PWQ_ERROR_GECOS_CHECK:
-                return C_("Password hint", "Try to avoid using your name in the password.");
+                return C_("Password hint", "This is a weak password. Try to avoid using your name in the 
password.");
         case PWQ_ERROR_BAD_WORDS:
-                return C_("Password hint", "Try to avoid some of the words included in the password.");
+                return C_("Password hint", "This is a weak password. Try to avoid some of the words included 
in the password.");
         case PWQ_ERROR_ROTATED:
-                return C_("Password hint", "Try changing the password a bit more.");
+                return C_("Password hint", "This password is very similar to your last one. Try changing the 
password a bit more.");
         case PWQ_ERROR_CRACKLIB_CHECK:
-                return C_("Password hint", "Try to avoid common words.");
+                return C_("Password hint", "This is a weak password. Try to avoid common words.");
         case PWQ_ERROR_PALINDROME:
-                return C_("Password hint", "Try to avoid reordering existing words.");
+                return C_("Password hint", "This is a weak password. Try to avoid reordering existing 
words.");
         case PWQ_ERROR_MIN_DIGITS:
-                return C_("Password hint", "Try to use more numbers.");
+                return C_("Password hint", "This is a weak password. Try to use more numbers.");
         case PWQ_ERROR_MIN_UPPERS:
-                return C_("Password hint", "Try to use more uppercase letters.");
+                return C_("Password hint", "This is a weak password. Try to use more uppercase letters.");
         case PWQ_ERROR_MIN_LOWERS:
-                return C_("Password hint", "Try to use more lowercase letters.");
+                return C_("Password hint", "This is a weak password. Try to use more lowercase letters.");
         case PWQ_ERROR_MIN_OTHERS:
-                return C_("Password hint", "Try to use more special characters, like punctuation.");
+                return C_("Password hint", "This is a weak password. Try to use more special characters, 
like punctuation.");
         case PWQ_ERROR_MIN_CLASSES:
-                return C_("Password hint", "Try to use a mixture of letters, numbers and punctuation.");
+                return C_("Password hint", "This is a weak password. Try to use a mixture of letters, 
numbers and punctuation.");
         case PWQ_ERROR_MAX_CONSECUTIVE:
-                return C_("Password hint", "Try to avoid repeating the same character.");
+                return C_("Password hint", "This is a weak password. Try to avoid repeating the same 
character.");
         case PWQ_ERROR_MAX_CLASS_REPEAT:
-                return C_("Password hint", "Try to avoid repeating the same type of character: you need to 
mix up letters, numbers and punctuation.");
+                return C_("Password hint", "This is a weak password. Try to avoid repeating the same type of 
character: you need to mix up letters, numbers and punctuation.");
         case PWQ_ERROR_MAX_SEQUENCE:
-                return C_("Password hint", "Try to avoid sequences like 1234 or abcd.");
+                return C_("Password hint", "This is a weak password. Try to avoid sequences like 1234 or 
abcd.");
         case PWQ_ERROR_MIN_LENGTH:
-                return C_("Password hint", "Password needs to be longer. Try to add more letters, numbers 
and punctuation.");
+                return C_("Password hint", "This is a weak password. Try to add more letters, numbers and 
punctuation.");
         case PWQ_ERROR_EMPTY_PASSWORD:
                 return C_("Password hint", "Mix uppercase and lowercase and try to use a number or two.");
         default:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]