X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fuser_ops.c;h=6851c805937bdf51006c4a0f419925b6885e9d3f;hb=d93eb617b45525ca350d4a35fe3aa98a3569abcf;hp=fe830092701028dc7c3fd35added29a94ca64bdb;hpb=29a778c8f17c370f90029b9214801c44f7a1f05c;p=citadel.git diff --git a/citadel/user_ops.c b/citadel/user_ops.c index fe8300927..6851c8059 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -652,13 +652,14 @@ void do_login(void) /* * If we are using LDAP authentication, extract the user's email addresses from the directory. - * FIXME make this a site configurable setting */ #ifdef HAVE_LDAP if ((CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP) || (CtdlGetConfigInt("c_auth_mode") == AUTHMODE_LDAP_AD)) { char new_emailaddrs[512]; - if (extract_email_addresses_from_ldap(CCC->ldap_dn, new_emailaddrs) == 0) { - strcpy(CCC->user.emailaddrs, new_emailaddrs); + if (CtdlGetConfigInt("c_ldap_sync_email_addrs") > 0) { + if (extract_email_addresses_from_ldap(CCC->ldap_dn, new_emailaddrs) == 0) { + CtdlSetEmailAddressesForUser(CCC->user.fullname, new_emailaddrs); + } } } #endif