diff options
Diffstat (limited to 'addressbook/backend/ebook')
-rw-r--r-- | addressbook/backend/ebook/e-book-listener.c | 27 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-book-listener.h | 1 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-book.c | 38 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-book.h | 7 |
4 files changed, 73 insertions, 0 deletions
diff --git a/addressbook/backend/ebook/e-book-listener.c b/addressbook/backend/ebook/e-book-listener.c index abdda55b59..5e1ff72da3 100644 --- a/addressbook/backend/ebook/e-book-listener.c +++ b/addressbook/backend/ebook/e-book-listener.c @@ -188,6 +188,20 @@ e_book_listener_queue_link_status (EBookListener *listener, } static void +e_book_listener_queue_authentication_response (EBookListener *listener, + EBookStatus status) +{ + EBookListenerResponse *resp; + + resp = g_new0 (EBookListenerResponse, 1); + + resp->op = AuthenticationResponse; + resp->status = status; + + e_book_listener_queue_response (listener, resp); +} + +static void impl_BookListener_respond_create_card (PortableServer_Servant servant, const GNOME_Evolution_Addressbook_BookListener_CallStatus status, const GNOME_Evolution_Addressbook_CardId id, @@ -326,6 +340,17 @@ impl_BookListener_report_open_book_progress (PortableServer_Servant servant, } static void +impl_BookListener_respond_authentication_result (PortableServer_Servant servant, + const GNOME_Evolution_Addressbook_BookListener_CallStatus status, + CORBA_Environment *ev) +{ + EBookListener *listener = E_BOOK_LISTENER (bonobo_object_from_servant (servant)); + + e_book_listener_queue_authentication_response ( + listener, status); +} + +static void impl_BookListener_report_connection_status (PortableServer_Servant servant, const CORBA_boolean connected, CORBA_Environment *ev) @@ -561,6 +586,8 @@ e_book_listener_get_epv (void) epv->notifyCardRemoved = impl_BookListener_respond_remove_card; epv->notifyCardModified = impl_BookListener_respond_modify_card; + epv->notifyAuthenticationResult = impl_BookListener_respond_authentication_result; + epv->notifyCursorRequested = impl_BookListener_respond_get_cursor; epv->notifyViewRequested = impl_BookListener_respond_get_view; epv->notifyChangesRequested = impl_BookListener_respond_get_changes; diff --git a/addressbook/backend/ebook/e-book-listener.h b/addressbook/backend/ebook/e-book-listener.h index d553324ee4..42b4644e60 100644 --- a/addressbook/backend/ebook/e-book-listener.h +++ b/addressbook/backend/ebook/e-book-listener.h @@ -46,6 +46,7 @@ typedef enum { GetCursorResponse, GetBookViewResponse, GetChangesResponse, + AuthenticationResponse, /* Async events */ LinkStatusEvent, diff --git a/addressbook/backend/ebook/e-book.c b/addressbook/backend/ebook/e-book.c index f6e6b324d9..65ea7a595d 100644 --- a/addressbook/backend/ebook/e-book.c +++ b/addressbook/backend/ebook/e-book.c @@ -351,6 +351,7 @@ e_book_check_listener_queue (EBookListener *listener, EBook *book) break; case RemoveCardResponse: case ModifyCardResponse: + case AuthenticationResponse: e_book_do_response_generic (book, resp); break; case GetCursorResponse: @@ -560,6 +561,43 @@ e_book_new (void) return book; } +/* User authentication. */ + +void +e_book_authenticate_user (EBook *book, + const char *user, + const char *passwd, + EBookCallback cb, + gpointer closure) +{ + CORBA_Environment ev; + + g_return_if_fail (book != NULL); + g_return_if_fail (E_IS_BOOK (book)); + + if (book->priv->load_state != URILoaded) { + g_warning ("e_book_authenticate_user: No URI loaded!\n"); + return; + } + + CORBA_exception_init (&ev); + + GNOME_Evolution_Addressbook_Book_authenticateUser (book->priv->corba_book, + user, + passwd, + &ev); + + if (ev._major != CORBA_NO_EXCEPTION) { + g_warning ("e_book_authenticate_user: Exception authenticating user with the PAS!\n"); + CORBA_exception_free (&ev); + return; + } + + CORBA_exception_free (&ev); + + e_book_queue_op (book, cb, closure, NULL); +} + /* Fetching cards */ /** diff --git a/addressbook/backend/ebook/e-book.h b/addressbook/backend/ebook/e-book.h index 3c3f2bc65b..7dd0917d37 100644 --- a/addressbook/backend/ebook/e-book.h +++ b/addressbook/backend/ebook/e-book.h @@ -59,6 +59,13 @@ gboolean e_book_load_uri (EBook *book, void e_book_unload_uri (EBook *book); char *e_book_get_static_capabilities (EBook *book); +/* User authentication. */ +void e_book_authenticate_user (EBook *book, + const char *user, + const char *passwd, + EBookCallback cb, + gpointer closure); + /* Fetching cards. */ ECard *e_book_get_card (EBook *book, const char *id); |