Re: [evolution-patches] fix for #313078 (gw-account-setup plugin)



pl. ignore the prev. patch that was wrong.
Here is the proper one.
Thanks
Vivek 
On Mon, 2005-08-22 at 12:16 +0000, "Jain Vivek"  wrote:
> hi,
> 
> The attached patch fixes 
> http://bugzilla.gnome.org/show_bug.cgi?id=313078
> 
> We have to uncache the password, as in 'groupwise' by default we
> remember the password. This used to keep trying to authenticate with the
> old password.
> 
> This also fixes (removes) another authentication pop up dialog when
> 'cancel' is pressed while enabling an account.
> 
> Thanks,
> 
> Vivek Jain
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/plugins/groupwise-account-setup/ChangeLog,v
retrieving revision 1.19
diff -u -p -r1.19 ChangeLog
--- ChangeLog	4 Aug 2005 05:28:00 -0000	1.19
+++ ChangeLog	22 Aug 2005 12:25:44 -0000
@@ -1,3 +1,11 @@
+2005-08-22 Vivek Jain <jvivek novell com>
+	
+	* camel-gw-listener.c:(get_addressbook_names_from_server)
+	uncache the password if it could not authenticate, else since we
+	remember it always it kept getting wrong one 
+	use 'flags' variable which served no purpose till now
+	**Fixes #313078
+	
 2005-07-27  Sankar P  <psankar novell com>
 
 	* camel-gw-listener.c (get_addressbook_names_from_server) :
Index: camel-gw-listener.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/groupwise-account-setup/camel-gw-listener.c,v
retrieving revision 1.36
diff -u -p -r1.36 camel-gw-listener.c
--- camel-gw-listener.c	4 Aug 2005 05:28:00 -0000	1.36
+++ camel-gw-listener.c	22 Aug 2005 12:25:45 -0000
@@ -428,13 +428,13 @@ get_addressbook_names_from_server (char 
 	const char *soap_port;
 	CamelURL *url;
 	gboolean remember;
-	char *failed_auth; 
+	char *failed_auth = NULL; 
 	char *prompt;
 	char *password_prompt;
 	char *uri;
 	const char *use_ssl;
 	const char *poa_address;
-	guint32 flags = E_PASSWORDS_REMEMBER_FOREVER;
+	guint32 flags = E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET;
 
 	url = camel_url_new (source_url, NULL);
         if (url == NULL) {
@@ -456,17 +456,22 @@ get_addressbook_names_from_server (char 
 	else 
 		uri = g_strdup_printf ("http://%s:%s/soap";, poa_address, soap_port);
 	
-	failed_auth = "";
 	cnc = NULL;
 	do {
+		/*we have to uncache the password before prompting again*/
+		if (failed_auth) {
+			e_passwords_forget_password ("Groupwise", key);
+			password = NULL;
+		}
+
 		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);
+			prompt = g_strconcat (failed_auth ? 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,
+					flags, &remember,
 					NULL);
 			g_free (prompt);
 
@@ -494,6 +499,8 @@ get_addressbook_names_from_server (char 
 	    
 		       
 	}
+	/*FIXME: This error message should be relocated to addressbook and should reflect 
+	 * that it actually failed to get the addressbooks*/
 	e_error_run (NULL, "mail:gw-accountsetup-error", poa_address, NULL);
 	return NULL;
 }


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