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



Hi, sush

Here's the updated patch. Can I commit it now? 

Thanks 

--Irene 

On Sat, 2005-12-10 at 18:17, Sushma Rai wrote:
> I am not sure what problem will be fixed by this patch,
> because there is already a check       
> if (password && !valid) {
> 	e_passwords_forget_password ("Exchange", key);
> }
> which is now moved inside if (password) condition, which will
> make the code look good, thats all.
> And key has to be freed even in case of remembered password.
> 
> Am I missing something?
> 
> -Sushma.
> 
> Which what 
> 
> On Fri, 2005-12-09 at 11:52 +0800, Irene Huang wrote:
> > 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
> > _______________________________________________
> > Evolution-patches mailing list
> > Evolution-patches gnome org
> > http://mail.gnome.org/mailman/listinfo/evolution-patches
> _______________________________________________
> Evolution-patches mailing list
> Evolution-patches gnome org
> http://mail.gnome.org/mailman/listinfo/evolution-patches
Index: servers/exchange/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/exchange/ChangeLog,v
retrieving revision 1.40
diff -u -r1.40 ChangeLog
--- servers/exchange/ChangeLog	10 Dec 2005 10:07:12 -0000	1.40
+++ servers/exchange/ChangeLog	12 Dec 2005 06:49:12 -0000
@@ -1,3 +1,10 @@
+2005-12-11  Irene Huang <Irene Huang sun com>
+
+	* lib/e2k-autoconfig.c: (e2k_validate_user): If password
+	exists, used the remembered password to do the
+	authentification. If validation failed, forget password.
+
+
 2005-12-10  Sushma Rai  <rsushma novell com>
 
 	* storage/exchange-account.c (exchange_account_connect): set
Index: servers/exchange/lib/e2k-autoconfig.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/exchange/lib/e2k-autoconfig.c,v
retrieving revision 1.5
diff -u -r1.5 e2k-autoconfig.c
--- servers/exchange/lib/e2k-autoconfig.c	28 Sep 2005 13:35:18 -0000	1.5
+++ servers/exchange/lib/e2k-autoconfig.c	12 Dec 2005 06:49:12 -0000
@@ -1576,32 +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);
+	else {
+		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);
 
 	return valid;


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