aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-session.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-11-15 02:36:14 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-11-15 02:36:14 +0800
commitace512904be73e3e1865c22a9f837c0baa840a43 (patch)
tree33aac920f42200768d142fef89a697d44396b43c /mail/mail-session.c
parent5b55bd6c92f031b71ec6fbbd1a900ee315f035e2 (diff)
downloadgsoc2013-evolution-ace512904be73e3e1865c22a9f837c0baa840a43.tar.gz
gsoc2013-evolution-ace512904be73e3e1865c22a9f837c0baa840a43.tar.zst
gsoc2013-evolution-ace512904be73e3e1865c22a9f837c0baa840a43.zip
Call e_passwords_remember_password() for account passwords if the user set
2001-11-13 Jeffrey Stedfast <fejj@ximian.com> * mail-session.c (pass_got): Call e_passwords_remember_password() for account passwords if the user set the "remember password" checkbox. svn path=/trunk/; revision=14696
Diffstat (limited to 'mail/mail-session.c')
-rw-r--r--mail/mail-session.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/mail/mail-session.c b/mail/mail-session.c
index b9449033eb..f8265a12ea 100644
--- a/mail/mail-session.c
+++ b/mail/mail-session.c
@@ -177,14 +177,14 @@ static void
pass_got (char *string, void *data)
{
struct _pass_msg *m = data;
-
+
if (string) {
MailConfigService *service = NULL;
const MailConfigAccount *mca;
- gboolean remember;
+ gboolean cache, remember;
m->result = g_strdup (string);
- remember = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (m->check));
+ remember = cache = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (m->check));
if (m->service_url) {
mca = mail_config_get_account_by_source_url (m->service_url);
if (mca) {
@@ -196,17 +196,26 @@ pass_got (char *string, void *data)
}
if (service) {
- mail_config_service_set_save_passwd (service, remember);
+ mail_config_service_set_save_passwd (service, cache);
- /* set `remember' to TRUE because people don't want to have to
+ /* set `cache' to TRUE because people don't want to have to
re-enter their passwords for this session even if they told
us not to cache their passwords in the dialog...*sigh* */
- remember = TRUE;
+ cache = TRUE;
}
+ } else {
+ /* we can't remember the password if it isn't for an account (pgp?) */
+ remember = FALSE;
}
- if (remember)
- e_passwords_add_password(m->key, m->result);
+ if (cache) {
+ /* cache the password for the session */
+ e_passwords_add_password (m->key, m->result);
+
+ /* should we remember it between sessions? */
+ if (remember)
+ e_passwords_remember_password (m->key);
+ }
} else {
camel_exception_set(m->ex, CAMEL_EXCEPTION_USER_CANCEL, _("User canceled operation."));
}