[evolution-patches] 308512, mail password lockdown doesn't



two patches required, one to fix a bug in the mail code enabling the
save-password checkbox, and another oen to eds to extend e-passwords to
provide functionality required

Index: libedataserverui/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserverui/ChangeLog,v
retrieving revision 1.57
diff -u -p -r1.57 ChangeLog
--- libedataserverui/ChangeLog	25 Jul 2005 06:52:42 -0000	1.57
+++ libedataserverui/ChangeLog	4 Aug 2005 04:47:37 -0000
@@ -1,3 +1,10 @@
+2005-08-04  Not Zed  <NotZed Ximian com>
+
+	** See bug #308512.
+
+	* e-passwords.c (ep_ask_password): implement new flag to disable
+	the remember password box.
+
 2005-07-24  Vivek Jain  <jvivek novell com>
 	
 	* e-name-selector-dialog.c: "Section" structure has two new members
Index: libedataserverui/e-passwords.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserverui/e-passwords.c,v
retrieving revision 1.27
diff -u -p -r1.27 e-passwords.c
--- libedataserverui/e-passwords.c	19 Jul 2005 08:12:10 -0000	1.27
+++ libedataserverui/e-passwords.c	4 Aug 2005 04:47:38 -0000
@@ -472,6 +472,8 @@ ep_ask_password(EPassMsg *msg)
 								: _("_Remember this password for the remainder of this session"));
 		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (msg->check), *msg->remember);
 		gtk_box_pack_start (GTK_BOX (vbox), msg->check, TRUE, FALSE, 3);
+		if ((msg->flags & E_PASSWORDS_DISABLE_REMEMBER))
+			gtk_widget_set_sensitive(msg->check, FALSE);
 		gtk_widget_show (msg->check);
 	}
 	
Index: libedataserverui/e-passwords.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserverui/e-passwords.h,v
retrieving revision 1.10
diff -u -p -r1.10 e-passwords.h
--- libedataserverui/e-passwords.h	30 Aug 2004 04:31:52 -0000	1.10
+++ libedataserverui/e-passwords.h	4 Aug 2005 04:47:38 -0000
@@ -57,6 +57,7 @@ typedef enum {
 	E_PASSWORDS_SECRET = 1<<8,
 	E_PASSWORDS_REPROMPT = 1<<9,
 	E_PASSWORDS_ONLINE = 1<<10, /* only ask if we're online */
+	E_PASSWORDS_DISABLE_REMEMBER = 1<<11, /* disable the 'remember password' checkbox */
 } EPasswordsRememberType;
 
 char *      e_passwords_ask_password      (const char *title, 
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3673
diff -u -p -r1.3673 ChangeLog
--- mail/ChangeLog	4 Aug 2005 02:53:34 -0000	1.3673
+++ mail/ChangeLog	4 Aug 2005 04:49:11 -0000
@@ -1,3 +1,13 @@
+2005-08-04  Not Zed  <NotZed Ximian com>
+
+	** See bug #308512.
+
+	* em-account-editor.c (emae_authtype_changed): take into account
+	the writability of the password when sensitising remember
+	password.
+	(get_password): small hack to disable the save-password button
+	when appropriate.
+
 2005-08-03  Not Zed  <NotZed Ximian com>
 
 	* em-folder-browser.c (emfb_set_folder): not here.
Index: mail/em-account-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-account-editor.c,v
retrieving revision 1.30
diff -u -p -r1.30 em-account-editor.c
--- mail/em-account-editor.c	29 Jul 2005 06:16:15 -0000	1.30
+++ mail/em-account-editor.c	4 Aug 2005 04:49:12 -0000
@@ -1412,7 +1412,10 @@ emae_authtype_changed(GtkComboBox *dropd
 	}
 	camel_url_free(url);
 
-	gtk_widget_set_sensitive((GtkWidget *)service->remember, authtype?authtype->need_password:FALSE);
+	gtk_widget_set_sensitive((GtkWidget *)service->remember,
+				 authtype
+				 ?(authtype->need_password && e_account_writable(service->emae->account, emae_service_info[service->type].save_passwd_key))
+				 :FALSE);
 }
 
 static void
Index: mail/mail-session.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-session.c,v
retrieving revision 1.106
diff -u -p -r1.106 mail-session.c
--- mail/mail-session.c	6 Jul 2005 04:54:32 -0000	1.106
+++ mail/mail-session.c	4 Aug 2005 04:49:12 -0000
@@ -221,6 +221,12 @@ get_password (CamelSession *session, Cam
 			if (flags & CAMEL_SESSION_PASSWORD_SECRET)
 				eflags |= E_PASSWORDS_SECRET;
 
+			/* HACK: breaks abstraction ...
+			   e_account_writable doesn't use the eaccount, it also uses the same writable key for
+			   source and transport */
+			if (!e_account_writable(NULL, E_ACCOUNT_SOURCE_SAVE_PASSWD))
+				eflags |= E_PASSWORDS_DISABLE_REMEMBER;
+
 			ret = e_passwords_ask_password(title, domain, key, prompt, eflags, &remember, NULL);
 
 			g_free(title);


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