aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/pas/pas-book.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2003-01-10 09:55:27 +0800
committerChris Toshok <toshok@src.gnome.org>2003-01-10 09:55:27 +0800
commit2a174936f49118ce60e76b0debe4600fdbb4bc33 (patch)
tree7bce87f3a0a6ca53f04d5c63f6ed2aa4aece5fea /addressbook/backend/pas/pas-book.c
parent50a352b3670e6b8e8d29a9559d2442fcf0b62c5e (diff)
downloadgsoc2013-evolution-2a174936f49118ce60e76b0debe4600fdbb4bc33.tar
gsoc2013-evolution-2a174936f49118ce60e76b0debe4600fdbb4bc33.tar.gz
gsoc2013-evolution-2a174936f49118ce60e76b0debe4600fdbb4bc33.tar.bz2
gsoc2013-evolution-2a174936f49118ce60e76b0debe4600fdbb4bc33.tar.lz
gsoc2013-evolution-2a174936f49118ce60e76b0debe4600fdbb4bc33.tar.xz
gsoc2013-evolution-2a174936f49118ce60e76b0debe4600fdbb4bc33.tar.zst
gsoc2013-evolution-2a174936f49118ce60e76b0debe4600fdbb4bc33.zip
build up the list of supported auth_methods.
2003-01-09 Chris Toshok <toshok@ximian.com> * backend/pas/pas-backend-ldap.c (query_ldap_root_dse): build up the list of supported auth_methods. (pas_backend_ldap_process_get_supported_auth_methods): respond with the list of auth methods we've built up. (pas_backend_ldap_dispose): unref the auth_method list. (pas_backend_ldap_class_init): hook up pas_backend_ldap_process_get_supported_auth_methods. * backend/pas/pas-backend.c (pas_backend_get_supported_auth_methods): new function. (process_client_requests): add clause for GetSupportedAuthMethods. * backend/pas/pas-backend.h: add prototype for pas_backend_get_supported_auth_methods, and add it to the class vtable. * backend/pas/pas-book.h: add GetSupportedAuthMethods enum member and PASGetSupportedAuthMethodsRequest. and add prototype for pas_book_respond_get_supported_auth_methods. * backend/pas/pas-book.c (pas_book_queue_get_supported_auth_methods): new function. (impl_GNOME_Evolution_Addressbook_Book_getSupportedAuthMethods): new function. (pas_book_respond_get_supported_auth_methods): new function. (pas_book_free_request): add clause for GetSupportedAuthMethods. (pas_book_class_init): hook up getSupportedAuthMethods. * backend/ebook/e-book-listener.c (e_book_listener_queue_get_supported_fields_response): fields -> list. (e_book_listener_queue_get_supported_auth_methods_response): new function. (impl_BookListener_response_get_supported_auth_methods): new function. (e_book_listener_class_init): hook up epv->notifySupportedAuthMethods. * backend/ebook/e-book-listener.h: add GetSupportedAuthMethodsResponse enum member, and change the field name from "fields" to list (and use it for both GetSupportedFields and GetSupportedAuthMethods) * backend/ebook/e-book.c (e_book_get_supported_auth_methods): new function. (e_book_do_response_get_supported_auth_methods): new function. * backend/ebook/e-book.h: add prototype for e_book_get_supported_auth_methods. * backend/idl/addressbook.idl: add getSupportedAuthMethods IDL call. svn path=/trunk/; revision=19386
Diffstat (limited to 'addressbook/backend/pas/pas-book.c')
-rw-r--r--addressbook/backend/pas/pas-book.c85
1 files changed, 73 insertions, 12 deletions
diff --git a/addressbook/backend/pas/pas-book.c b/addressbook/backend/pas/pas-book.c
index 9ca049e350..2cb373b9d7 100644
--- a/addressbook/backend/pas/pas-book.c
+++ b/addressbook/backend/pas/pas-book.c
@@ -153,6 +153,17 @@ pas_book_queue_get_supported_fields (PASBook *book)
pas_book_queue_request (book, req);
}
+static void
+pas_book_queue_get_supported_auth_methods (PASBook *book)
+{
+ PASRequest *req;
+
+ req = g_new0 (PASRequest, 1);
+ req->op = GetSupportedAuthMethods;
+
+ pas_book_queue_request (book, req);
+}
+
static void
pas_book_queue_get_book_view (PASBook *book, const GNOME_Evolution_Addressbook_BookViewListener listener, const char *search)
@@ -365,6 +376,15 @@ impl_GNOME_Evolution_Addressbook_Book_getSupportedFields (PortableServer_Servant
pas_book_queue_get_supported_fields (book);
}
+static void
+impl_GNOME_Evolution_Addressbook_Book_getSupportedAuthMethods (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ PASBook *book = PAS_BOOK (bonobo_object (servant));
+
+ pas_book_queue_get_supported_auth_methods (book);
+}
+
/**
* pas_book_get_backend:
*/
@@ -584,6 +604,43 @@ pas_book_respond_get_supported_fields (PASBook *book,
CORBA_free(stringlist._buffer);
}
+void
+pas_book_respond_get_supported_auth_methods (PASBook *book,
+ GNOME_Evolution_Addressbook_BookListener_CallStatus status,
+ EList *auth_methods)
+{
+ CORBA_Environment ev;
+ GNOME_Evolution_Addressbook_stringlist stringlist;
+ int num_auth_methods;
+ EIterator *iter;
+ int i;
+
+ CORBA_exception_init (&ev);
+
+ num_auth_methods = e_list_length (auth_methods);
+
+ stringlist._buffer = CORBA_sequence_CORBA_string_allocbuf (num_auth_methods);
+ stringlist._maximum = num_auth_methods;
+ stringlist._length = num_auth_methods;
+
+ iter = e_list_get_iterator (auth_methods);
+
+ for (i = 0; e_iterator_is_valid (iter); e_iterator_next (iter), i ++) {
+ stringlist._buffer[i] = CORBA_string_dup (e_iterator_get(iter));
+ }
+
+ g_object_unref (auth_methods);
+
+ GNOME_Evolution_Addressbook_BookListener_notifySupportedAuthMethods (
+ book->priv->listener, status,
+ &stringlist,
+ &ev);
+
+ CORBA_exception_free (&ev);
+
+ CORBA_free(stringlist._buffer);
+}
+
/**
* pas_book_respond_get_cursor:
*/
@@ -861,6 +918,9 @@ pas_book_free_request (PASRequest *req)
case GetSupportedFields:
/* nothing to free */
break;
+ case GetSupportedAuthMethods:
+ /* nothing to free */
+ break;
}
g_free (req);
@@ -927,18 +987,19 @@ pas_book_class_init (PASBookClass *klass)
epv = &klass->epv;
- epv->getVCard = impl_GNOME_Evolution_Addressbook_Book_getVCard;
- epv->authenticateUser = impl_GNOME_Evolution_Addressbook_Book_authenticateUser;
- epv->addCard = impl_GNOME_Evolution_Addressbook_Book_addCard;
- epv->removeCard = impl_GNOME_Evolution_Addressbook_Book_removeCard;
- epv->modifyCard = impl_GNOME_Evolution_Addressbook_Book_modifyCard;
- epv->checkConnection = impl_GNOME_Evolution_Addressbook_Book_checkConnection;
- epv->getStaticCapabilities = impl_GNOME_Evolution_Addressbook_Book_getStaticCapabilities;
- epv->getSupportedFields = impl_GNOME_Evolution_Addressbook_Book_getSupportedFields;
- epv->getCursor = impl_GNOME_Evolution_Addressbook_Book_getCursor;
- epv->getBookView = impl_GNOME_Evolution_Addressbook_Book_getBookView;
- epv->getCompletionView = impl_GNOME_Evolution_Addressbook_Book_getCompletionView;
- epv->getChanges = impl_GNOME_Evolution_Addressbook_Book_getChanges;
+ epv->getVCard = impl_GNOME_Evolution_Addressbook_Book_getVCard;
+ epv->authenticateUser = impl_GNOME_Evolution_Addressbook_Book_authenticateUser;
+ epv->addCard = impl_GNOME_Evolution_Addressbook_Book_addCard;
+ epv->removeCard = impl_GNOME_Evolution_Addressbook_Book_removeCard;
+ epv->modifyCard = impl_GNOME_Evolution_Addressbook_Book_modifyCard;
+ epv->checkConnection = impl_GNOME_Evolution_Addressbook_Book_checkConnection;
+ epv->getStaticCapabilities = impl_GNOME_Evolution_Addressbook_Book_getStaticCapabilities;
+ epv->getSupportedFields = impl_GNOME_Evolution_Addressbook_Book_getSupportedFields;
+ epv->getSupportedAuthMethods = impl_GNOME_Evolution_Addressbook_Book_getSupportedAuthMethods;
+ epv->getCursor = impl_GNOME_Evolution_Addressbook_Book_getCursor;
+ epv->getBookView = impl_GNOME_Evolution_Addressbook_Book_getBookView;
+ epv->getCompletionView = impl_GNOME_Evolution_Addressbook_Book_getCompletionView;
+ epv->getChanges = impl_GNOME_Evolution_Addressbook_Book_getChanges;
}
static void