From f0c9a1218925074be201882b7eb41c3c5902bfda Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 25 Feb 2008 20:38:15 +0000 Subject: Accept empty password to unlock a token; and allow empty new password if the requested password quality allows it. Bug #515096, patch by Thomas Wendt. svn path=/trunk/; revision=7982 --- lib/ephy-password-dialog.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'lib') diff --git a/lib/ephy-password-dialog.c b/lib/ephy-password-dialog.c index 72d6f7e22..660004a83 100644 --- a/lib/ephy-password-dialog.c +++ b/lib/ephy-password-dialog.c @@ -43,9 +43,8 @@ enum { CHECK_USER = 1 << 0, CHECK_DOMAIN = 1 << 1, - CHECK_PWD = 1 << 2, - CHECK_PWD_MATCH = 1 << 3, - CHECK_PWD_QUALITY = 1 << 4, + CHECK_PWD_MATCH = 1 << 2, + CHECK_PWD_QUALITY = 1 << 3, CHECK_MASK = 0x1f }; @@ -169,10 +168,6 @@ entry_changed_cb (GtkWidget *entry, { flag = CHECK_DOMAIN; } - else if (entry == priv->entry[PASSWORD_ENTRY]) - { - flag = CHECK_PWD; - } text = gtk_entry_get_text (GTK_ENTRY (entry)); if (text != NULL && text[0] != '\0') @@ -429,9 +424,7 @@ ephy_password_dialog_constructor (GType type, _("_Password:"), TRUE, TRUE, - G_CALLBACK (entry_changed_cb)); - - priv->checks |= CHECK_PWD; + NULL); } if (priv->flags & EPHY_PASSWORD_DIALOG_FLAGS_SHOW_NEW_PASSWORD) @@ -455,8 +448,6 @@ ephy_password_dialog_constructor (GType type, TRUE, TRUE, G_CALLBACK (password_entry_changed_cb)); - - priv->checks |= CHECK_PWD_MATCH; } if (priv->flags & (EPHY_PASSWORD_DIALOG_FLAGS_SHOW_PASSWORD | @@ -481,7 +472,8 @@ ephy_password_dialog_constructor (GType type, add_row (table, row++, _("Password quality:"), priv->quality_meter); - priv->checks |= CHECK_PWD_QUALITY; + /* Update the quality meter now, so we allow empty new password if quality is 0. */ + password_entry_changed_cb (priv->entry[NEW_PASSWORD_ENTRY], password_dialog); } /* Removed unused table rows */ -- cgit v1.2.3