evolution-exchange r1739 - in trunk: . addressbook



Author: mcrha
Date: Tue Aug 12 08:45:31 2008
New Revision: 1739
URL: http://svn.gnome.org/viewvc/evolution-exchange?rev=1739&view=rev

Log:
2008-08-12  Milan Crha  <mcrha redhat com>

	** Part of fix for bug #547308

	* addressbook/e-book-backend-gal.c: (gal_connect): Distinguish
	between GAL offline and unsupported authentication method used.
	* addressbook/e-book-backend-gal.c: (ldap_reconnect), (gal_reconnect),
	(build_contact_from_entry): Adapt to new function prototype from EDS.

Note: Required eds revision 9327.


Modified:
   trunk/ChangeLog
   trunk/addressbook/e-book-backend-gal.c

Modified: trunk/addressbook/e-book-backend-gal.c
==============================================================================
--- trunk/addressbook/e-book-backend-gal.c	(original)
+++ trunk/addressbook/e-book-backend-gal.c	Tue Aug 12 08:45:31 2008
@@ -248,6 +248,7 @@
 gal_connect (EBookBackendGAL *bl)
 {
 	EBookBackendGALPrivate *blpriv = bl->priv;
+	int ldap_error = 0;
 
 #ifdef DEBUG
 	{
@@ -268,9 +269,13 @@
 
 	g_object_ref (blpriv->gc);
 	g_mutex_lock (blpriv->ldap_lock);
-	blpriv->ldap = e2k_global_catalog_get_ldap (blpriv->gc, NULL);
+	blpriv->ldap = e2k_global_catalog_get_ldap (blpriv->gc, NULL, &ldap_error);
 	if (!blpriv->ldap) {
 		g_mutex_unlock (blpriv->ldap_lock);
+		d(printf ("%s: Cannot get ldap, error 0x%x (%s)\n", G_STRFUNC, ldap_error, ldap_err2string (ldap_error) ? ldap_err2string (ldap_error) : "Unknown error"));
+		if (ldap_error == LDAP_AUTH_METHOD_NOT_SUPPORTED)
+			return GNOME_Evolution_Addressbook_UnsupportedAuthenticationMethod;
+
 		return GNOME_Evolution_Addressbook_RepositoryOffline;
 	}
 	g_mutex_unlock (blpriv->ldap_lock);
@@ -292,7 +297,7 @@
 			book_view_notify_status (book_view, _("Reconnecting to LDAP server..."));
 
 		ldap_unbind (*ldap);
-		*ldap = e2k_global_catalog_get_ldap (bl->priv->gc, NULL);
+		*ldap = e2k_global_catalog_get_ldap (bl->priv->gc, NULL, NULL);
 		if (book_view)
 			book_view_notify_status (book_view, "");
 
@@ -313,7 +318,7 @@
 			book_view_notify_status (book_view, _("Reconnecting to LDAP server..."));
 		if (bl->priv->ldap)
 			ldap_unbind (bl->priv->ldap);
-		bl->priv->ldap = e2k_global_catalog_get_ldap (bl->priv->gc, NULL);
+		bl->priv->ldap = e2k_global_catalog_get_ldap (bl->priv->gc, NULL, NULL);
 		if (book_view)
 			book_view_notify_status (book_view, "");
 
@@ -1428,7 +1433,7 @@
 							char **email_values, **cn_values, **member_info;
 
 							if (!subldap) {
-								subldap = e2k_global_catalog_get_ldap (bl->priv->gc, NULL);
+								subldap = e2k_global_catalog_get_ldap (bl->priv->gc, NULL, NULL);
 							}
 							grpattrs[0] = "cn";
 							grpattrs[1] = "mail";



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