diff options
author | Sushma Rai <rsushma@src.gnome.org> | 2005-12-19 22:15:11 +0800 |
---|---|---|
committer | Sushma Rai <rsushma@src.gnome.org> | 2005-12-19 22:15:11 +0800 |
commit | 85dcfd1f8e40ac729fd7b0995d799bd59070839d (patch) | |
tree | e3e88edbd8cb9ca49c992c4f3429cea70c108fe8 | |
parent | 25393123affda80dddbeea3dbbbf89c1ce8657a6 (diff) | |
download | gsoc2013-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
-rw-r--r-- | plugins/exchange-operations/ChangeLog | 18 | ||||
-rw-r--r-- | plugins/exchange-operations/exchange-account-setup.c | 4 | ||||
-rw-r--r-- | plugins/exchange-operations/exchange-config-listener.c | 29 |
3 files changed, 45 insertions, 6 deletions
diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog index b8cd722394..0b75458331 100644 --- a/plugins/exchange-operations/ChangeLog +++ b/plugins/exchange-operations/ChangeLog @@ -1,5 +1,23 @@ 2005-12-19 Sushma Rai <rsushma@novell.com> + * exchange-account-setup.c (owa_authenticate_user): Adding the + parameter "save-passwd" to CamelURL, during account creation, which can + be used to see if the user has remembered password or password is + temporarily remembered so that password is not prompted second time at + the end of account creation. + + * exchange-config-listener.c (exchange_config_listener_authenticate): + Using the flag E_PASSWORDS_REMEMBER_FOREVER instead of + E_PASSWORDS_REMEMBER_SESSION. Reading the save-passwd URL parameter to + see if the password was remembered by the user or remembered + temporarily by the plugin and foget it in case of remembered by the + plugin. Also free CamelURL. + (account_added): Calling exchange_config_listener_authenticate(). + + Fixes #324485 + +2005-12-19 Sushma Rai <rsushma@novell.com> + * exchange-account-setup.c (org_gnome_exchange_settings) (owa_editor_entry_changed)(org_gnome_exchange_owa_url) (org_gnome_exchange_commit): free CamelURL. diff --git a/plugins/exchange-operations/exchange-account-setup.c b/plugins/exchange-operations/exchange-account-setup.c index 383d5f6b13..2bbf963970 100644 --- a/plugins/exchange-operations/exchange-account-setup.c +++ b/plugins/exchange-operations/exchange-account-setup.c @@ -478,8 +478,10 @@ owa_authenticate_user(GtkWidget *button, EConfig *config) print_error (owa_url, result); camel_url_set_host (url, valid ? exchange_params->host : ""); - if (valid) + if (valid) { camel_url_set_authmech (url, exchange_params->is_ntlm ? "NTLM" : "Basic"); + camel_url_set_param (url, "save-passwd", remember_password? "true" : "false"); + } camel_url_set_param (url, "ad_server", valid ? exchange_params->ad_server: NULL); camel_url_set_param (url, "mailbox", valid ? exchange_params->mailbox : NULL); camel_url_set_param (url, "owa_path", valid ? exchange_params->owa_path : NULL); 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); } |