From 5dca3046d3ad660485cc68e3c9f4ef3f98a5922d Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Fri, 5 Jan 2001 02:22:47 +0000 Subject: new function. (impl_BookListener_respond_authentication_result): new 2001-01-04 Chris Toshok * backend/ebook/e-book-listener.c (e_book_listener_queue_authentication_response): new function. (impl_BookListener_respond_authentication_result): new function. (e_book_listener_get_epv): fill in epv->notifyAuthenticationResult. * backend/ebook/e-book-listener.h: add AuthenticationResponse to EBookListenerOperation. * backend/ebook/e-book.c (e_book_authenticate_user): new function. * backend/ebook/e-book.h: add prototype for e_book_authenticate_user. * backend/idl/addressbook.idl (GNOME:Evolution:Addressbook:Book): add authenticateUser method. (GNOME:Evolution:Addressbook:BookListener): add AuthenticationFailed and AuthenticationRequired to CallStatus. also add notifyAuthenticationResult method. * backend/pas/pas-backend-file.c (pas_backend_file_process_authenticate_user): dummy authenticate_user function that always succeeds. (pas_backend_file_process_client_requests): respond to the AuthenticateUser request. * backend/pas/pas-backend-ldap.c (pas_backend_ldap_build_query): gtk_object_unref(sexp) => s_exp_unref(sexp). (pas_backend_ldap_process_authenticate_user): fill in to use ldap_simple_bind_s. (pas_backend_ldap_process_client_requests): respond to the AuthenticateUser request. * backend/pas/pas-book.c (pas_book_queue_authenticate_user): new function. (impl_GNOME_Evolution_Addressbook_Book_authenticateUser): new function. (pas_book_respond_authenticate_user): new function. (pas_book_get_epv): fill in epv->authenticateUser. * backend/pas/pas-book.h: add AuthenticateUser operation type, and add user/passwd to the PASRequest struct. * gui/component/addressbook-storage.c (addressbook_storage_get_source_by_uri): new function. should use a hashtable, perhaps, but the lists will generally be small anyway. * gui/component/addressbook-storage.h: add prototype for addressbook_storage_get_source_by_uri. * gui/component/addressbook-config.c (addressbook_source_dialog_set_source): fill in the binddn if the auth page is shown. * gui/component/addressbook.c (book_open_cb): shoe-horn authentication in here. if the source was configured to use authentication, authenticate the user after opening the ebook. also, be paranoid and clear out the password after authenticating. (book_auth_cb): callback for auth. set the "book" arg on the view->view here. (passwd_cb): set the view's passwd that'll be used in book_open_cb. (addressbook_view_free): g_free view->passwd. svn path=/trunk/; revision=7265 --- addressbook/backend/ebook/e-book-listener.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'addressbook/backend/ebook/e-book-listener.c') 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 @@ -187,6 +187,20 @@ e_book_listener_queue_link_status (EBookListener *listener, e_book_listener_queue_response (listener, resp); } +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, @@ -325,6 +339,17 @@ impl_BookListener_report_open_book_progress (PortableServer_Servant servant, listener, status_message, percent); } +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, @@ -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; -- cgit v1.2.3