evolution-data-server r9295 - in trunk/addressbook: . backends/ldap
- From: mcrha svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r9295 - in trunk/addressbook: . backends/ldap
- Date: Thu, 7 Aug 2008 12:06:52 +0000 (UTC)
Author: mcrha
Date: Thu Aug 7 12:06:51 2008
New Revision: 9295
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9295&view=rev
Log:
2008-08-07 Milan Crha <mcrha redhat com>
** Fix for bug #324203
* backends/ldap/e-book-backend-ldap.c: (can_browse),
(ldap_search_handler), (e_book_backend_ldap_search),
(e_book_backend_ldap_remove): Check for source option "can-browse"
in LDAP address books and if present, then search until reaches limits
for empty searches.
Modified:
trunk/addressbook/ChangeLog
trunk/addressbook/backends/ldap/e-book-backend-ldap.c
Modified: trunk/addressbook/backends/ldap/e-book-backend-ldap.c
==============================================================================
--- trunk/addressbook/backends/ldap/e-book-backend-ldap.c (original)
+++ trunk/addressbook/backends/ldap/e-book-backend-ldap.c Thu Aug 7 12:06:51 2008
@@ -454,6 +454,15 @@
}
#endif
+static gboolean
+can_browse (EBookBackend *backend)
+{
+ return backend &&
+ e_book_backend_get_source (backend) &&
+ e_source_get_property (e_book_backend_get_source (backend), "can-browse") &&
+ strcmp (e_source_get_property (e_book_backend_get_source (backend), "can-browse"), "1") == 0;
+}
+
static void
book_view_notify_status (EDataBookView *view, const char *status)
{
@@ -4165,7 +4174,10 @@
}
ldap_memfree (ldap_error_msg);
- if (ldap_error == LDAP_TIMELIMIT_EXCEEDED)
+ if ((ldap_error == LDAP_TIMELIMIT_EXCEEDED || ldap_error == LDAP_SIZELIMIT_EXCEEDED) && can_browse ((EBookBackend *)bl))
+ /* do not complain when search limit exceeded for browseable LDAPs */
+ e_data_book_view_notify_complete (view, GNOME_Evolution_Addressbook_Success);
+ else if (ldap_error == LDAP_TIMELIMIT_EXCEEDED)
e_data_book_view_notify_complete (view, GNOME_Evolution_Addressbook_SearchTimeLimitExceeded);
else if (ldap_error == LDAP_SIZELIMIT_EXCEEDED)
e_data_book_view_notify_complete (view, GNOME_Evolution_Addressbook_SearchSizeLimitExceeded);
@@ -4247,6 +4259,10 @@
case GNOME_Evolution_Addressbook_MODE_REMOTE :
ldap_query = e_book_backend_ldap_build_query (bl, e_data_book_view_get_card_query (view));
+ /* search for nonempty full names */
+ if (!ldap_query && can_browse ((EBookBackend *)bl))
+ ldap_query = g_strdup ("(cn=*)");
+
g_static_rec_mutex_lock (&eds_ldap_handler_lock);
if (ldap_query != NULL && bl->priv->ldap) {
int ldap_err;
@@ -4900,7 +4916,10 @@
static char*
e_book_backend_ldap_get_static_capabilities (EBookBackend *backend)
{
- return g_strdup("net,anon-access,do-initial-query,contact-lists");
+ if (can_browse (backend))
+ return g_strdup ("net,anon-access,contact-lists,do-initial-query");
+ else
+ return g_strdup("net,anon-access,contact-lists");
}
#if 0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]