[evolution-patches] [exchange connector] fix for validation during autoconfig



Hi, Exchange developers

	I found that when we are reconfiguring an exchange account, clicking
the authenticate button on the "receiving email" tab will trigger very
strange behaviors. When the password is saved before, evolution tries to
forget the password word and an error dialog emerges, only when the
password is not saved can a dialog be popped up asking the users for
input. 

	I  created a patch for this bug, please reviews.

Thanks 

--Irene
Index: servers/exchange/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/exchange/ChangeLog,v
retrieving revision 1.29.2.6
diff -u -r1.29.2.6 ChangeLog
--- servers/exchange/ChangeLog	26 Nov 2005 09:08:40 -0000	1.29.2.6
+++ servers/exchange/ChangeLog	6 Dec 2005 07:03:13 -0000
@@ -1,3 +1,9 @@
+2005-11-29  Irene Huang <Irene Huang sun com>
+
+	* lib/e2k-autoconfig.c: (e2k_validate_user): If the password
+	exists, used the remembered password to do the authentification
+	If validation failed, forget password.
+
 2005-11-25  Sushma Rai  <rsushma novell com>
 
 	* storage/exchange-account.c (exchange_account_remove_folder)
Index: servers/exchange/lib/e2k-autoconfig.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/exchange/lib/e2k-autoconfig.c,v
retrieving revision 1.4.2.1
diff -u -r1.4.2.1 e2k-autoconfig.c
--- servers/exchange/lib/e2k-autoconfig.c	28 Sep 2005 13:27:03 -0000	1.4.2.1
+++ servers/exchange/lib/e2k-autoconfig.c	6 Dec 2005 07:03:13 -0000
@@ -1576,33 +1576,34 @@
 					"Exchange", key, prompt,
 					E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET,
 					&remember, NULL);
-		if (password) {
-			valid = validate (owa_url, user, password, exchange_params, result);
-			if (valid) {
-				/* generate the proper key once the host name 
-				 * is read and remember password temporarily, 
-				 * so that at the end of * account creation, 
-				 * user will not be prompted, for password will
-				 * not be asked again. 
-				 */
-
-				*remember_password = remember;
-				g_free (key);
-				if (exchange_params->is_ntlm)
-					key = g_strdup_printf ("exchange://%s;auth=NTLM %s/", 
-								       user, exchange_params->host);
-				else
-					key = g_strdup_printf ("exchange://%s %s/", user, exchange_params->host);
-				e_passwords_add_password (key, password);
-				e_passwords_remember_password ("Exchange", key);
-			}
-		}
 		g_free (prompt);
 	}
-	if (password && !valid) {
-		e_passwords_forget_password ("Exchange", key);
+	if (password) {
+		valid = validate (owa_url, user, password, exchange_params, result);
+		if (valid) {
+			/* generate the proper key once the host name 
+			 * is read and remember password temporarily, 
+			 * so that at the end of * account creation, 
+			 * user will not be prompted, for password will
+			 * not be asked again. 
+			 */
+
+			*remember_password = remember;
+			g_free (key);
+			if (exchange_params->is_ntlm)
+				key = g_strdup_printf ("exchange://%s;auth=NTLM %s/", 
+							       user, exchange_params->host);
+			else
+				key = g_strdup_printf ("exchange://%s %s/", user, exchange_params->host);
+			e_passwords_add_password (key, password);
+			e_passwords_remember_password ("Exchange", key);
+		}
+		else {
+			/* if validation failed*/
+			e_passwords_forget_password ("Exchange", key);
+		}
+		g_free (key);
 	}
-	g_free (key);
 
 	return valid;
 }


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