aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorSankar P <psankar@novell.com>2005-08-04 13:28:00 +0800
committerSankarasivasubramanian Pasupathilingam <psankar@src.gnome.org>2005-08-04 13:28:00 +0800
commitbe73726a2f4ea94ff1a2ef346c57dcdad1f4252e (patch)
tree0a5d76cd931f86dabe041fd18f1149face3bbbcd /plugins
parent1b28d2f6d535e314f29e30a68b2386716053914a (diff)
downloadgsoc2013-evolution-be73726a2f4ea94ff1a2ef346c57dcdad1f4252e.tar.gz
gsoc2013-evolution-be73726a2f4ea94ff1a2ef346c57dcdad1f4252e.tar.zst
gsoc2013-evolution-be73726a2f4ea94ff1a2ef346c57dcdad1f4252e.zip
Added code to get the password from the cache, instead of asking the user
2005-07-27 Sankar P <psankar@novell.com> * camel-gw-listener.c (get_addressbook_names_from_server) : Added code to get the password from the cache, instead of asking the user twice. and also freeing the password that was leaking before. Fixes #310353 svn path=/trunk/; revision=29981
Diffstat (limited to 'plugins')
-rw-r--r--plugins/groupwise-account-setup/ChangeLog7
-rw-r--r--plugins/groupwise-account-setup/camel-gw-listener.c30
2 files changed, 25 insertions, 12 deletions
diff --git a/plugins/groupwise-account-setup/ChangeLog b/plugins/groupwise-account-setup/ChangeLog
index 3ee3025ece..7ce45ca221 100644
--- a/plugins/groupwise-account-setup/ChangeLog
+++ b/plugins/groupwise-account-setup/ChangeLog
@@ -1,3 +1,10 @@
+2005-07-27 Sankar P <psankar@novell.com>
+
+ * camel-gw-listener.c (get_addressbook_names_from_server) :
+ Added code to get the password from the cache, instead of asking the user twice.
+ and also freeing the password that was leaking before.
+ Fixes #310353
+
2005-07-23 Sushma Rai <rsushma@novell.com>
* camel-gw-listener.c (add_addressbook_sources): marking
diff --git a/plugins/groupwise-account-setup/camel-gw-listener.c b/plugins/groupwise-account-setup/camel-gw-listener.c
index 8474d25b37..c2f6e0c7c2 100644
--- a/plugins/groupwise-account-setup/camel-gw-listener.c
+++ b/plugins/groupwise-account-setup/camel-gw-listener.c
@@ -458,24 +458,30 @@ get_addressbook_names_from_server (char *source_url)
failed_auth = "";
cnc = NULL;
- do {
- password_prompt = g_strdup_printf (_("Enter password for %s (user %s)"),
- poa_address, url->user);
- prompt = g_strconcat (failed_auth, password_prompt, NULL);
- g_free (password_prompt);
- password = e_passwords_ask_password (prompt, "Groupwise", key, prompt,
- E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET, &remember,
- NULL);
- g_free (prompt);
-
- if (!password)
- break;
+ do {
+ password = e_passwords_get_password ("Groupwise", key);
+ if (!password) {
+ password_prompt = g_strdup_printf (_("Enter password for %s (user %s)"),
+ poa_address, url->user);
+ prompt = g_strconcat (failed_auth, password_prompt, NULL);
+ g_free (password_prompt);
+ password = e_passwords_ask_password (prompt, "Groupwise", key, prompt,
+ E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET, &remember,
+ NULL);
+ g_free (prompt);
+
+ if (!password)
+ break;
+ }
cnc = e_gw_connection_new (uri, url->user, password);
if (!E_IS_GW_CONNECTION(cnc) && use_ssl && g_str_equal (use_ssl, "when-possible")) {
char *http_uri = g_strconcat ("http://", uri + 8, NULL);
cnc = e_gw_connection_new (http_uri, url->user, password);
g_free (http_uri);
}
+
+ g_free (password);
+
failed_auth = _("Failed to authenticate.\n");
flags |= E_PASSWORDS_REPROMPT;
} while (cnc == NULL);