From 2230772b04f3b7c58dd02a820d8983c63d6370ca Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 16 Mar 2014 20:15:27 -0400 Subject: [PATCH] ldap.c mods submitted by Harry Coin for populating vCard from LDAP --- citadel/ldap.c | 204 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 190 insertions(+), 14 deletions(-) diff --git a/citadel/ldap.c b/citadel/ldap.c index 864ab4807..f5461f299 100644 --- a/citadel/ldap.c +++ b/citadel/ldap.c @@ -2,7 +2,7 @@ * These functions implement the portions of AUTHMODE_LDAP and AUTHMODE_LDAP_AD which * actually speak to the LDAP server. * - * Copyright (c) 2011 by Art Cancro and the citadel.org development team. + * Copyright (c) 2011-2014 by the citadel.org development team. * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 3. @@ -72,8 +72,8 @@ int CtdlTryUserLDAP(char *username, if (ldap_initialize(&ldserver, config.c_ldap_host)) { syslog(LOG_ALERT, "LDAP: Could not connect to %s:%d : %s\n", - config.c_ldap_host, config.c_ldap_port, - strerror(errno) + config.c_ldap_host, config.c_ldap_port, + strerror(errno) ); return(errno); } @@ -237,6 +237,39 @@ int CtdlTryPasswordLDAP(char *user_dn, const char *password) } +//return !0 iff property changed. +int vcard_set_props_iff_different(struct vCard *v,char *propname,int numvals, char **vals) { + int i; + char *oldval; + for(i=0;i