[evolution-patches] Exchange Connector: Fix for 66926



Hi,

This patch fixes the authentication problem for form-based-authentication on the exchange server. This is needed for the gnome-2-8 branch as well.

Thanks
-- Sarfraaz
Index: storage/exchange-account.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/storage/exchange-account.c,v
retrieving revision 1.18
diff -u -p -u -p -r1.18 exchange-account.c
--- storage/exchange-account.c	27 Aug 2004 15:31:49 -0000	1.18
+++ storage/exchange-account.c	3 Nov 2004 13:12:01 -0000
@@ -66,7 +66,7 @@ struct _ExchangeAccountPrivate {
 	gboolean uris_use_email;
 
 	char *identity_name, *identity_email, *source_uri, *password_key;
-	char *username, *password, *ad_server;
+	char *username, *password, *windows_domain, *ad_server;
 	E2kAutoconfigAuthPref auth_pref;
 	int ad_limit;
 
@@ -265,6 +265,9 @@ finalize (GObject *object)
 			strlen (account->priv->password));
 		g_free (account->priv->password);
 	}
+	if (account->priv->windows_domain)
+		g_free (account->priv->windows_domain);
+
 	if (account->priv->ad_server)
 		g_free (account->priv->ad_server);
 
@@ -959,6 +962,7 @@ exchange_account_connect (ExchangeAccoun
 	struct dirent *dent;
 	DIR *d;
 	char *old_password, *new_password;
+	char *user_name = NULL;
 
 	g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
 
@@ -975,10 +979,18 @@ exchange_account_connect (ExchangeAccoun
 	account->priv->connecting = TRUE;
 	g_mutex_unlock (account->priv->connect_lock);
 
+	if (account->priv->windows_domain)
+		user_name = g_strdup_printf ("%s\\%s", account->priv->windows_domain, 
+							account->priv->username);
+	else
+		user_name = g_strdup (account->priv->username);
+
 	ac = e2k_autoconfig_new (account->home_uri,
 				 account->priv->username,
 				 NULL,
 				 account->priv->auth_pref);
+	g_free (user_name);
+
 	e2k_autoconfig_set_gc_server (ac, account->priv->ad_server,
 				      account->priv->ad_limit);
 
@@ -1508,6 +1520,12 @@ exchange_account_new (EAccountList *acco
 	account->priv->password_key = g_strdup_printf ("exchange://%s", account->priv->uri_authority);
 
 	account->priv->username = g_strdup (uri->user);
+
+	if (uri->domain)
+		account->priv->windows_domain = g_strdup (uri->domain);
+	else
+		account->priv->windows_domain = NULL;
+
 	account->exchange_server = g_strdup (uri->host);
 	if (uri->authmech && !strcmp (uri->authmech, "Basic"))
 		account->priv->auth_pref = E2K_AUTOCONFIG_USE_BASIC;


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