aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/exchange-operations/exchange-config-listener.c
diff options
context:
space:
mode:
authorSushma Rai <rsushma@src.gnome.org>2005-12-19 22:15:11 +0800
committerSushma Rai <rsushma@src.gnome.org>2005-12-19 22:15:11 +0800
commit85dcfd1f8e40ac729fd7b0995d799bd59070839d (patch)
treee3e88edbd8cb9ca49c992c4f3429cea70c108fe8 /plugins/exchange-operations/exchange-config-listener.c
parent25393123affda80dddbeea3dbbbf89c1ce8657a6 (diff)
downloadgsoc2013-evolution-85dcfd1f8e40ac729fd7b0995d799bd59070839d.tar
gsoc2013-evolution-85dcfd1f8e40ac729fd7b0995d799bd59070839d.tar.gz
gsoc2013-evolution-85dcfd1f8e40ac729fd7b0995d799bd59070839d.tar.bz2
gsoc2013-evolution-85dcfd1f8e40ac729fd7b0995d799bd59070839d.tar.lz
gsoc2013-evolution-85dcfd1f8e40ac729fd7b0995d799bd59070839d.tar.xz
gsoc2013-evolution-85dcfd1f8e40ac729fd7b0995d799bd59070839d.tar.zst
gsoc2013-evolution-85dcfd1f8e40ac729fd7b0995d799bd59070839d.zip
Checking if the user has selected save password option or not and
accordingly prompting for the password whenever Evolution is restarted. Also, not asking for password twice during account creation. Fixes #324485. svn path=/trunk/; revision=30879
Diffstat (limited to 'plugins/exchange-operations/exchange-config-listener.c')
-rw-r--r--plugins/exchange-operations/exchange-config-listener.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/plugins/exchange-operations/exchange-config-listener.c b/plugins/exchange-operations/exchange-config-listener.c
index b711c63e0d..beb19a110f 100644
--- a/plugins/exchange-operations/exchange-config-listener.c
+++ b/plugins/exchange-operations/exchange-config-listener.c
@@ -588,21 +588,39 @@ exchange_config_listener_authenticate (ExchangeConfigListener *ex_conf_listener,
ExchangeConfigListenerPrivate *priv;
ExchangeAccountResult result;
char *key, *password, *title;
- gboolean remember = FALSE;
+ gboolean oldremember, remember = FALSE;
CamelURL *camel_url;
-
+ const char *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);
title = g_strdup_printf (_("Enter Password for %s"), account->account_name);
- password = e_passwords_ask_password (title, "Exchange", key, title, E_PASSWORDS_REMEMBER_SESSION|E_PASSWORDS_SECRET , &remember, NULL);
- }
+ password = e_passwords_ask_password (title, "Exchange", key, title,
+ E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET,
+ &remember, NULL);
+ if (remember != oldremember) {
+ exchange_account_set_save_password (account, remember);
+ }
+ g_free (title);
+ }
+ else if (remember_password && !g_strcasecmp (remember_password, "fasle")) {
+ /* 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
+ * asking for password again, at the end of account creation.
+ */
+ e_passwords_forget_password ("Exchange", key);
+ }
exchange_account_connect (account, password, &result);
-
+ g_free (key);
+ camel_url_free (camel_url);
return result;
}
@@ -658,6 +676,7 @@ account_added (EAccountList *account_list, EAccount *account)
return;
}
+ exchange_config_listener_authenticate (config_listener, exchange_account);
exchange_account_set_online (exchange_account);
}