[evolution-exchange] Bug #644644 - Exchange password not stored



commit a648956b31d49d9f0cae6ee2faec4c9bdf2fc194
Author: Milan Crha <mcrha redhat com>
Date:   Thu Mar 17 09:53:13 2011 +0100

    Bug #644644 - Exchange password not stored

 eplugin/exchange-account-setup.c   |    9 +++++++--
 eplugin/exchange-config-listener.c |    6 +-----
 2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/eplugin/exchange-account-setup.c b/eplugin/exchange-account-setup.c
index e854009..85839c1 100644
--- a/eplugin/exchange-account-setup.c
+++ b/eplugin/exchange-account-setup.c
@@ -508,8 +508,13 @@ owa_authenticate_user (GtkWidget *button, EConfig *config)
 
 	camel_url_set_host (url, valid ? exchange_params->host : "");
 
-	if (valid)
-		camel_url_set_param (url, "save-passwd", remember_password? "true" : "false");
+	if (valid) {
+		camel_url_set_param (url, "save-passwd", NULL);
+		if (target_account->account && target_account->account->source && target_account->account->transport) {
+			target_account->account->source->save_passwd = remember_password;
+			target_account->account->transport->save_passwd = remember_password;
+		}
+	}
 
 	camel_url_set_param (url, "ad_server", valid ? exchange_params->ad_server: NULL);
 	camel_url_set_param (url, "mailbox", valid ? exchange_params->mailbox : NULL);
diff --git a/eplugin/exchange-config-listener.c b/eplugin/exchange-config-listener.c
index 37273e2..7efd4c4 100644
--- a/eplugin/exchange-config-listener.c
+++ b/eplugin/exchange-config-listener.c
@@ -817,14 +817,12 @@ exchange_config_listener_authenticate (ExchangeConfigListener *ex_conf_listener,
 #endif
 	gboolean oldremember, remember = FALSE;
 	CamelURL *camel_url;
-	const gchar *remember_password;
 
 	g_return_val_if_fail (EXCHANGE_IS_CONFIG_LISTENER (ex_conf_listener), EXCHANGE_ACCOUNT_CONFIG_ERROR);
 	priv = ex_conf_listener->priv;
 
 	camel_url = camel_url_new (priv->configured_uri, NULL);
 	key = camel_url_to_string (camel_url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS);
-	remember_password = camel_url_get_param (camel_url, "save-passwd");
 	password = e_passwords_get_password ("Exchange", key);
 	if (!password) {
 		oldremember = remember = exchange_account_is_save_password (account);
@@ -834,7 +832,6 @@ exchange_config_listener_authenticate (ExchangeConfigListener *ex_conf_listener,
 						     &remember, NULL);
 		if (remember != oldremember) {
 			exchange_account_set_save_password (account, remember);
-			camel_url_set_param (camel_url, "save-passwd", remember? "true" : "false");
 			url_string = camel_url_to_string (camel_url, 0);
 			e_account_set_string (ex_conf_listener->priv->configured_account, E_ACCOUNT_SOURCE_URL, url_string);
 			e_account_set_string (ex_conf_listener->priv->configured_account, E_ACCOUNT_TRANSPORT_URL, url_string);
@@ -844,8 +841,7 @@ exchange_config_listener_authenticate (ExchangeConfigListener *ex_conf_listener,
 			g_free (url_string);
 		}
 		g_free (title);
-	}
-	else if (remember_password && !g_ascii_strcasecmp (remember_password, "false")) {
+	} else if (!exchange_account_is_save_password (account)) {
 		/* get_password returns the password cached but user has not
 		 * selected remember password option, forget this password
 		 * whis is stored temporarily by e2k_validate_user(), to avoid



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