diff options
author | Chris Toshok <toshok@helixcode.com> | 2000-07-27 03:48:35 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2000-07-27 03:48:35 +0800 |
commit | 305f2fe00235b6945031286ec198edced967c332 (patch) | |
tree | f4f49ec40bc93d34284cbc47ca73fb78ac0d9f9e /addressbook/backend | |
parent | 7467aa48ec4df79eea40b3305fe9ebb6b195031f (diff) | |
download | gsoc2013-evolution-305f2fe00235b6945031286ec198edced967c332.tar.gz gsoc2013-evolution-305f2fe00235b6945031286ec198edced967c332.tar.zst gsoc2013-evolution-305f2fe00235b6945031286ec198edced967c332.zip |
add support for user settable scope. (pas_backend_ldap_search): same.
2000-07-26 Chris Toshok <toshok@helixcode.com>
* backend/pas/pas-backend-ldap.c
(pas_backend_ldap_build_all_cards_list): add support for user settable scope.
(pas_backend_ldap_search): same.
(pas_backend_ldap_load_uri): same.
svn path=/trunk/; revision=4360
Diffstat (limited to 'addressbook/backend')
-rw-r--r-- | addressbook/backend/pas/pas-backend-ldap.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c index 6282135fe0..f032ab08d4 100644 --- a/addressbook/backend/pas/pas-backend-ldap.c +++ b/addressbook/backend/pas/pas-backend-ldap.c @@ -36,6 +36,7 @@ struct _PASBackendLDAPPrivate { gchar *ldap_host; gchar *ldap_rootdn; int ldap_port; + int ldap_scope; GList *book_views; }; @@ -210,7 +211,7 @@ pas_backend_ldap_build_all_cards_list(PASBackend *backend, if ((ldap_error = ldap_search_s (ldap, bl->priv->ldap_rootdn, - LDAP_SCOPE_ONELEVEL, + bl->priv->ldap_scope, "(objectclass=*)", NULL, 0, &res)) == -1) { g_warning ("ldap error '%s' in " @@ -697,12 +698,17 @@ pas_backend_ldap_search (PASBackendLDAP *bl, PASBook *book, PASBackendLDAPBookView *view) { - char *ldap_query = pas_backend_ldap_build_query(view->search); + char *ldap_query; + + if (view->search_idle) + g_warning ("pas_backend_ldap_search called again with pending search on this view.\n"); + + ldap_query = pas_backend_ldap_build_query(view->search); if (ldap_query != NULL) { LDAP *ldap; - pas_backend_ldap_ensure_connected(bl); + /* pas_backend_ldap_ensure_connected(bl);*/ ldap = bl->priv->ldap; @@ -712,7 +718,7 @@ pas_backend_ldap_search (PASBackendLDAP *bl, if ((view->search_msgid = ldap_search (ldap, bl->priv->ldap_rootdn, - LDAP_SCOPE_ONELEVEL, + bl->priv->ldap_scope, ldap_query, NULL, 0)) == -1) { g_warning ("ldap error '%s' in pas_backend_ldap_search\n", ldap_err2string(ldap->ld_errno)); @@ -761,7 +767,7 @@ pas_backend_ldap_process_get_book_view (PASBackend *backend, : Evolution_BookListener_CardNotFound /* XXX */), book_view); - view = g_new(PASBackendLDAPBookView, 1); + view = g_new0(PASBackendLDAPBookView, 1); view->book_view = book_view; view->search = g_strdup(req->search); view->blpriv = bl->priv; @@ -887,6 +893,7 @@ pas_backend_ldap_load_uri (PASBackend *backend, if (bl->priv->ldap_port == 0) bl->priv->ldap_port = 389; bl->priv->ldap_rootdn = g_strdup(lud->lud_dn); + bl->priv->ldap_scope = lud->lud_scope; ldap_free_urldesc(lud); |