Fixes the problem of validating and authenticating user only on pressing
authorSushma Rai <rsushma@src.gnome.org>
Thu, 15 Dec 2005 11:38:41 +0000 (11:38 +0000)
committerSushma Rai <rsushma@src.gnome.org>
Thu, 15 Dec 2005 11:38:41 +0000 (11:38 +0000)
"Authenticate" button twice, even if the user gives the proper password.

servers/exchange/ChangeLog
servers/exchange/lib/e2k-autoconfig.c

index 4af103a..a647af7 100644 (file)
@@ -1,3 +1,9 @@
+2005-12-15  Sushma Rai  <rsushma@novell.com>
+
+       * lib/e2k-autoconfig.c (e2k_validate_user): Fixes the problem
+       of validating and authenticating user only on pressing "Authenticate" 
+       button twice, even if the user gives the proper password.
+
 2005-12-11  Tor Lillqvist  <tml@novell.com>
 
        * lib/Makefile.am: Drop unused CONNECTOR_LOCALEDIR.
index 409faa8..f52c2c9 100644 (file)
@@ -1634,34 +1634,35 @@ e2k_validate_user (const char *owa_url, char *user,
                                        E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET,
                                        &remember, NULL);
                g_free (prompt);
-       }
-       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;
+               if (!password) {
                        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);
+                       return valid;
                }
        }
 
-       g_free (key);
+       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;
 }