$Log$
+ Revision 614.23 2004/02/08 05:29:34 ajc
+ * Corrected various small syntax conversion problems that were keeping
+ some vCards out of the LDAP directory.
+
Revision 614.22 2004/02/07 05:28:10 ajc
* Automatically purge files from ./network/spoolout which were intended
for nodes which no longer exist
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
if (msg->cm_fields['N'] == NULL) return;
/* Initialize variables */
- strcpy(givenname, "_");
- strcpy(sn, "_");
+ strcpy(givenname, "");
+ strcpy(sn, "");
sprintf(this_dn, "cn=%s,ou=%s,%s",
msg->cm_fields['A'],
/* Convert the vCard fields to LDAP properties */
v = vcard_load(msg->cm_fields['M']);
- if (v->numprops) for (i=0; i<(v->numprops); ++i) {
+ if (v->numprops) for (i=0; i<(v->numprops); ++i) if (striplt(v->prop[i].value), strlen(v->prop[i].value) > 0) {
if (!strcasecmp(v->prop[i].name, "n")) {
extract_token(sn, v->prop[i].value, 0, ';');
attrs[num_attrs-1]->mod_values[1] = NULL;
/* "givenname" (first name) based on info in vCard */
+ if (strlen(givenname) == 0) strcpy(givenname, "_");
+ if (strlen(sn) == 0) strcpy(sn, "_");
attrs = reallok(attrs, (sizeof(LDAPMod *) * ++num_attrs) );
attrs[num_attrs-1] = mallok(sizeof(LDAPMod));
memset(attrs[num_attrs-1], 0, sizeof(LDAPMod));