[evolution-mapi] Empty password is like no password, notify user about it



commit 56b07a2618ea451ae094e2acf4ae37f1ffaaccf6
Author: Milan Crha <mcrha redhat com>
Date:   Tue Feb 23 18:25:42 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 7bad6fe..db8ea89 100644
--- a/src/account-setup-eplugin/exchange-mapi-account-setup.c
+++ b/src/account-setup-eplugin/exchange-mapi-account-setup.c
@@ -218,10 +218,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 = e_account_get_bool (target_account->account, E_ACCOUNT_SOURCE_SAVE_PASSWD);
 		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,
@@ -263,6 +264,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]