diff options
author | Chris Toshok <toshok@ximian.com> | 2003-01-10 09:55:27 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2003-01-10 09:55:27 +0800 |
commit | 2a174936f49118ce60e76b0debe4600fdbb4bc33 (patch) | |
tree | 7bce87f3a0a6ca53f04d5c63f6ed2aa4aece5fea /addressbook/backend/ebook | |
parent | 50a352b3670e6b8e8d29a9559d2442fcf0b62c5e (diff) | |
download | gsoc2013-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/ebook')
-rw-r--r-- | addressbook/backend/ebook/e-book-listener.c | 41 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-book-listener.h | 5 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-book.c | 65 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-book.h | 4 |
4 files changed, 109 insertions, 6 deletions
diff --git a/addressbook/backend/ebook/e-book-listener.c b/addressbook/backend/ebook/e-book-listener.c index 6fb9b737ae..ecb9c0e9a8 100644 --- a/addressbook/backend/ebook/e-book-listener.c +++ b/addressbook/backend/ebook/e-book-listener.c @@ -360,10 +360,34 @@ e_book_listener_queue_get_supported_fields_response (EBookListener *listener, resp->op = GetSupportedFieldsResponse; resp->status = status; - resp->fields = e_list_new ((EListCopyFunc)g_strdup, (EListFreeFunc)g_free, NULL); + resp->list = e_list_new ((EListCopyFunc)g_strdup, (EListFreeFunc)g_free, NULL); for (i = 0; i < fields->_length; i ++) { - e_list_append (resp->fields, fields->_buffer[i]); + e_list_append (resp->list, fields->_buffer[i]); + } + + e_book_listener_queue_response (listener, resp); +} + +static void +e_book_listener_queue_get_supported_auth_methods_response (EBookListener *listener, + EBookStatus status, + const GNOME_Evolution_Addressbook_stringlist *auth_methods) +{ + EBookListenerResponse *resp; + int i; + + if (listener->priv->stopped) + return; + + resp = g_new0 (EBookListenerResponse, 1); + + resp->op = GetSupportedAuthMethodsResponse; + resp->status = status; + resp->list = e_list_new ((EListCopyFunc)g_strdup, (EListFreeFunc)g_free, NULL); + + for (i = 0; i < auth_methods->_length; i ++) { + e_list_append (resp->list, auth_methods->_buffer[i]); } e_book_listener_queue_response (listener, resp); @@ -545,6 +569,18 @@ impl_BookListener_response_get_supported_fields (PortableServer_Servant servant, } static void +impl_BookListener_response_get_supported_auth_methods (PortableServer_Servant servant, + const GNOME_Evolution_Addressbook_BookListener_CallStatus status, + const GNOME_Evolution_Addressbook_stringlist *auth_methods, + CORBA_Environment *ev) +{ + EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant)); + + e_book_listener_queue_get_supported_auth_methods_response ( + listener, status, auth_methods); +} + +static void impl_BookListener_report_connection_status (PortableServer_Servant servant, const CORBA_boolean connected, CORBA_Environment *ev) @@ -745,6 +781,7 @@ e_book_listener_class_init (EBookListenerClass *klass) epv->notifyCardModified = impl_BookListener_respond_modify_card; epv->notifyAuthenticationResult = impl_BookListener_respond_authentication_result; epv->notifySupportedFields = impl_BookListener_response_get_supported_fields; + epv->notifySupportedAuthMethods = impl_BookListener_response_get_supported_auth_methods; epv->notifyCardRequested = impl_BookListener_respond_get_vcard; epv->notifyCursorRequested = impl_BookListener_respond_get_cursor; epv->notifyViewRequested = impl_BookListener_respond_get_view; diff --git a/addressbook/backend/ebook/e-book-listener.h b/addressbook/backend/ebook/e-book-listener.h index 26cd684aab..1b02dd4bb6 100644 --- a/addressbook/backend/ebook/e-book-listener.h +++ b/addressbook/backend/ebook/e-book-listener.h @@ -57,6 +57,7 @@ typedef enum { GetChangesResponse, AuthenticationResponse, GetSupportedFieldsResponse, + GetSupportedAuthMethodsResponse, /* Async events */ LinkStatusEvent, @@ -79,8 +80,8 @@ typedef struct { /* For GetBookViewReponse */ GNOME_Evolution_Addressbook_BookView book_view; - /* For GetSupportedFields */ - EList *fields; + /* For GetSupportedFields/GetSupportedAuthMethods */ + EList *list; /* For OpenProgressEvent */ char *msg; diff --git a/addressbook/backend/ebook/e-book.c b/addressbook/backend/ebook/e-book.c index 2ec99c1a37..195418d29b 100644 --- a/addressbook/backend/ebook/e-book.c +++ b/addressbook/backend/ebook/e-book.c @@ -481,12 +481,38 @@ e_book_do_response_get_supported_fields (EBook *book, if (op->cb) { if (op->active) - ((EBookFieldsCallback) op->cb) (book, resp->status, resp->fields, op->closure); + ((EBookFieldsCallback) op->cb) (book, resp->status, resp->list, op->closure); else ((EBookFieldsCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure); } - g_object_unref(resp->fields); + g_object_unref(resp->list); + + e_book_op_free (op); +} + +static void +e_book_do_response_get_supported_auth_methods (EBook *book, + EBookListenerResponse *resp) +{ + EBookOp *op; + + op = e_book_pop_op (book); + + if (op == NULL) { + g_warning ("e_book_do_response_get_supported_auth_methods: Cannot find operation " + "in local op queue!\n"); + return; + } + + if (op->cb) { + if (op->active) + ((EBookAuthMethodsCallback) op->cb) (book, resp->status, resp->list, op->closure); + else + ((EBookAuthMethodsCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure); + } + + g_object_unref(resp->list); e_book_op_free (op); } @@ -531,6 +557,9 @@ e_book_check_listener_queue (EBookListener *listener, EBook *book) case GetSupportedFieldsResponse: e_book_do_response_get_supported_fields (book, resp); break; + case GetSupportedAuthMethodsResponse: + e_book_do_response_get_supported_auth_methods (book, resp); + break; case OpenProgressEvent: e_book_do_progress_event (book, resp); @@ -870,6 +899,38 @@ e_book_get_supported_fields (EBook *book, return tag; } +guint +e_book_get_supported_auth_methods (EBook *book, + EBookAuthMethodsCallback cb, + gpointer closure) +{ + CORBA_Environment ev; + guint tag; + + CORBA_exception_init (&ev); + + if (book->priv->load_state != URILoaded) { + g_warning ("e_book_unload_uri: No URI is loaded!\n"); + return 0; + } + + tag = e_book_queue_op (book, cb, closure, NULL); + + GNOME_Evolution_Addressbook_Book_getSupportedAuthMethods(book->priv->corba_book, &ev); + + if (ev._major != CORBA_NO_EXCEPTION) { + g_warning ("e_book_get_supported_auth_methods: Exception " + "during get_supported_auth_methods!\n"); + CORBA_exception_free (&ev); + e_book_unqueue_op (book); + return 0; + } + + CORBA_exception_free (&ev); + + return tag; +} + static gboolean e_book_construct (EBook *book) { diff --git a/addressbook/backend/ebook/e-book.h b/addressbook/backend/ebook/e-book.h index c7b8a100e8..bbc49b711c 100644 --- a/addressbook/backend/ebook/e-book.h +++ b/addressbook/backend/ebook/e-book.h @@ -60,6 +60,7 @@ typedef void (*EBookCardCallback) (EBook *book, EBookStatus status, ECard *c typedef void (*EBookCursorCallback) (EBook *book, EBookStatus status, ECardCursor *cursor, gpointer closure); typedef void (*EBookBookViewCallback) (EBook *book, EBookStatus status, EBookView *book_view, gpointer closure); typedef void (*EBookFieldsCallback) (EBook *book, EBookStatus status, EList *fields, gpointer closure); +typedef void (*EBookAuthMethodsCallback) (EBook *book, EBookStatus status, EList *auth_methods, gpointer closure); /* Creating a new addressbook. */ EBook *e_book_new (void); @@ -78,6 +79,9 @@ guint e_book_get_supported_fields (EBook *book, EBookFieldsCallback cb, gpointer closure); +guint e_book_get_supported_auth_methods (EBook *book, + EBookAuthMethodsCallback cb, + gpointer closure); /* User authentication. */ void e_book_authenticate_user (EBook *book, |