aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/addressbook.c
diff options
context:
space:
mode:
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;