aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/addressbook.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-01-25 12:22:58 +0800
committerChris Toshok <toshok@src.gnome.org>2002-01-25 12:22:58 +0800
commit9b1f4e133bc79b2cac6cf342972c713739b075a6 (patch)
tree07066b05749e5327182a0a6b45df3f2ca29d952a /addressbook/gui/component/addressbook.c
parent19bf10036145eb24280ac5792dd85add67d4d238 (diff)
downloadgsoc2013-evolution-9b1f4e133bc79b2cac6cf342972c713739b075a6.tar
gsoc2013-evolution-9b1f4e133bc79b2cac6cf342972c713739b075a6.tar.gz
gsoc2013-evolution-9b1f4e133bc79b2cac6cf342972c713739b075a6.tar.bz2
gsoc2013-evolution-9b1f4e133bc79b2cac6cf342972c713739b075a6.tar.lz
gsoc2013-evolution-9b1f4e133bc79b2cac6cf342972c713739b075a6.tar.xz
gsoc2013-evolution-9b1f4e133bc79b2cac6cf342972c713739b075a6.tar.zst
gsoc2013-evolution-9b1f4e133bc79b2cac6cf342972c713739b075a6.zip
[ fixes bug 16097 ] gui love for the new auth stuff.
2002-01-24 Chris Toshok <toshok@ximian.com> [ fixes bug 16097 ] * gui/component/addressbook-config.glade: gui love for the new auth stuff. * gui/component/addressbook.c (load_uri_cb): track change to auth, and offer up different prompt strings depending on which method (binddn or email) we're using. * gui/component/addressbook-storage.c (ldap_unparse_auth): use the new auth types for ldap. (ldap_parse_auth): same. (addressbook_storage_auth_type_to_string): new function. (load_source_data): get the binddn too. (ldap_source_foreach): store out binddn or emailaddr, depending on the auth type chosen. * gui/component/addressbook-storage.h: add the more detailed auth types, add "binddn" to the source structure, and add a prototype for addressbook_storage_auth_type_to_string. * gui/component/addressbook-config.c (auth_checkbutton_changed): set the auth stuff (in)sensitive. (auth_optionmenu_activated): new function. (addressbook_source_dialog_set_source): track UI change. (addressbook_source_dialog_get_source): same. (add_scope_activate_cb): rename add_activate_cb to this to distinguish it from the auth stuff. (add_auth_activate_cb): new function. (addressbook_source_dialog): track change to auth UI stuff. (addressbook_storage_auth_type_to_string): new function. * backend/ebook/e-book.h: add auth_method arg to e_book_authenticate_user. * backend/ebook/e-book.c (e_book_authenticate_user): track change to prototype - add auth_method arg, and pass it along to the CORBA call. * backend/ebook/test-client.c (book_open_cb): track api change - keep this building. * backend/pas/pas-book.h: add auth_method slot in PASRequest. * backend/pas/pas-book.c (pas_book_queue_authenticate_user): add auth_method arg and add it to the PASRequest. (impl_GNOME_Evolution_Addressbook_Book_authenticateUser): track idl change, add auth_method and pass it along to pas_book_queue_authenticate_user. * backend/pas/pas-backend-ldap.c (pas_backend_ldap_process_authenticate_user): support both "ldap/simple-email" and "ldap/simple-binddn" auth methods. * backend/idl/addressbook.idl: add "in string authMethod" to authenticateUser. svn path=/trunk/; revision=15467
Diffstat (limited to 'addressbook/gui/component/addressbook.c')
-rw-r--r--addressbook/gui/component/addressbook.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index 93c3bdf246..74aceb9c4e 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -641,7 +641,7 @@ load_uri_cb (EBook *book, EBookStatus status, gpointer closure)
if (source &&
source->type == ADDRESSBOOK_SOURCE_LDAP &&
- source->auth == ADDRESSBOOK_LDAP_AUTH_SIMPLE) {
+ source->auth != ADDRESSBOOK_LDAP_AUTH_NONE) {
const char *password;
char *pass_dup = NULL;
@@ -651,7 +651,12 @@ load_uri_cb (EBook *book, EBookStatus status, gpointer closure)
char *prompt;
gboolean remember;
- prompt = g_strdup_printf (_("Enter password for %s (user %s)"), source->name, source->email_addr);
+ if (source->auth == ADDRESSBOOK_LDAP_AUTH_SIMPLE_BINDDN)
+ prompt = g_strdup_printf (_("Enter password for %s (user %s)"),
+ source->name, source->binddn);
+ else
+ prompt = g_strdup_printf (_("Enter password for %s (user %s)"),
+ source->name, source->email_addr);
remember = source->remember_passwd;
pass_dup = e_passwords_ask_password (
prompt, load_uri_data->uri, prompt, TRUE,
@@ -665,7 +670,16 @@ load_uri_cb (EBook *book, EBookStatus status, gpointer closure)
}
if (password || pass_dup) {
- e_book_authenticate_user (book, source->email_addr, password ? password : pass_dup,
+ char *user;
+
+ if (source->auth == ADDRESSBOOK_LDAP_AUTH_SIMPLE_BINDDN)
+ user = source->binddn;
+ else
+ user = source->email_addr;
+ if (!user)
+ user = "";
+ e_book_authenticate_user (book, user, password ? password : pass_dup,
+ addressbook_storage_auth_type_to_string (source->auth),
load_uri_auth_cb, closure);
g_free (pass_dup);
return;