[evolution-mapi/gnome-2-28] Empty password is like no password, notify user about it



commit b801f5f328f76f48e86bc74e226dd1a3ed3c3ef4
Author: Milan Crha <mcrha redhat com>
Date:   Tue Feb 23 18:28:48 2010 +0100

    Empty password is like no password, notify user about it

 .../exchange-mapi-account-setup.c                  |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/account-setup-eplugin/exchange-mapi-account-setup.c b/src/account-setup-eplugin/exchange-mapi-account-setup.c
index 862c827..ee8590e 100644
--- a/src/account-setup-eplugin/exchange-mapi-account-setup.c
+++ b/src/account-setup-eplugin/exchange-mapi-account-setup.c
@@ -208,10 +208,11 @@ validate_credentials (GtkWidget *widget, EConfig *config)
 
 	key = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS);
 	password = e_passwords_get_password (EXCHANGE_MAPI_PASSWORD_COMPONENT, key);
-	if (!password) {
+	if (!password || !*password) {
 		gboolean remember = FALSE;
 		gchar *title;
 
+		g_free (password);
 		title = g_strdup_printf (_("Enter Password for %s %s"), url->user, url->host);
 		password = e_passwords_ask_password (title, EXCHANGE_MAPI_PASSWORD_COMPONENT, key, title,
 						     E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET,
@@ -253,6 +254,9 @@ validate_credentials (GtkWidget *widget, EConfig *config)
 		}
 
 		g_free (error_msg);
+	} else {
+		e_passwords_forget_password (EXCHANGE_MAPI_PASSWORD_COMPONENT, key);
+		e_notice (NULL, GTK_MESSAGE_ERROR, "%s", _("Authentication failed."));
 	}
 
 	g_free (password);



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