}
}
- if (!strcasecmp(v->prop[i].name, "tel;home"))
+ if ( (!strcasecmp(v->prop[i].name, "tel;home"))
+ || (!strcasecmp(v->prop[i].name, "tel;type=home")) )
(void) CtdlDoDirectoryServiceFunc("homePhone", v->prop[i].value, &objectlist, "ldap", DIRECTORY_ATTRIB_ADD);
else
- if (!strcasecmp(v->prop[i].name, "tel;fax"))
+ if ( (!strcasecmp(v->prop[i].name, "tel;fax"))
+ || (!strcasecmp(v->prop[i].name, "tel;type=fax")) )
(void) CtdlDoDirectoryServiceFunc("facsimileTelephoneNumber", v->prop[i].value, &objectlist, "ldap", DIRECTORY_ATTRIB_ADD);
else
- if (!strcasecmp(v->prop[i].name, "tel;cell"))
+ if ( (!strcasecmp(v->prop[i].name, "tel;cell"))
+ || (!strcasecmp(v->prop[i].name, "tel;type=cell")) )
(void) CtdlDoDirectoryServiceFunc("mobile", v->prop[i].value, &objectlist, "ldap", DIRECTORY_ATTRIB_ADD);
else
if ( (!strcasecmp(v->prop[i].name, "tel"))
*/
void vcard_extract_vcard(char *name, char *filename, char *partnum, char *disp,
void *content, char *cbtype, char *cbcharset, size_t length,
- char *encoding, void *cbuserdata)
+ char *encoding, char *cbid, void *cbuserdata)
{
struct vCard **v = (struct vCard **) cbuserdata;
* But if the user was an Aide or was edited by an Aide then we can
* Assume they don't need validating.
*/
- if (CC->user.axlevel >= 6)
+ if (CC->user.axlevel >= 6) {
+ lgetuser(&CC->user, CC->curr_user);
+ CC->user.flags |= US_REGIS;
+ lputuser(&CC->user);
return (0);
+ }
set_mm_valid();
* Write our config to disk
*/
void vcard_write_user(struct ctdluser *u, struct vCard *v) {
- char temp[PATH_MAX];
- FILE *fp;
char *ser;
- CtdlMakeTempFileName(temp, sizeof temp);
ser = vcard_serialize(v);
-
- fp = fopen(temp, "w");
- if (fp == NULL) return;
if (ser == NULL) {
- fprintf(fp, "begin:vcard\r\nend:vcard\r\n");
- } else {
- fwrite(ser, strlen(ser), 1, fp);
- free(ser);
+ ser = strdup("begin:vcard\r\nend:vcard\r\n");
}
- fclose(fp);
+ if (!ser) return;
/* This handy API function does all the work for us.
* NOTE: normally we would want to set that last argument to 1, to
* have to, because the vcard_upload_beforesave() hook above
* is going to notice what we're trying to do, and delete the old vCard.
*/
- CtdlWriteObject(USERCONFIGROOM, /* which room */
- VCARD_MIME_TYPE,/* MIME type */
- temp, /* temp file */
- u, /* which user */
- 0, /* not binary */
- 0, /* don't delete others of this type */
- 0); /* no flags */
-
- unlink(temp);
+ CtdlWriteObject(USERCONFIGROOM, /* which room */
+ VCARD_MIME_TYPE, /* MIME type */
+ ser, /* data */
+ strlen(ser)+1, /* length */
+ u, /* which user */
+ 0, /* not binary */
+ 0, /* don't delete others of this type */
+ 0); /* no flags */
+
+ free(ser);
}
}
}
}
- if (a==5) vcard_set_prop(my_vcard, "tel;home", buf, 0);
+ if (a==5) vcard_set_prop(my_vcard, "tel", buf, 0);
if (a==6) vcard_set_prop(my_vcard, "email;internet", buf, 0);
if (a==7) strcpy(tmpcountry, buf);
++a;
extract_token(buf, adr, 5, ';', sizeof buf);
cprintf("%s\n", buf); /* zip */
- s = vcard_get_prop(v, "tel;home", 0, 0, 0);
+ s = vcard_get_prop(v, "tel", 0, 0, 0);
if (s == NULL) s = vcard_get_prop(v, "tel", 1, 0, 0);
if (s != NULL) {
cprintf("%s\n", s);
#ifdef SOLARIS_GETPWUID
if (getpwuid_r(usbuf->uid, &pwd, pwd_buffer, sizeof pwd_buffer) != NULL) {
#else // SOLARIS_GETPWUID
- struct passwd **result = NULL;
- if (getpwuid_r(usbuf->uid, &pwd, pwd_buffer, sizeof pwd_buffer, result) == 0) {
+ struct passwd *result = NULL;
+ CtdlLogPrintf(CTDL_DEBUG, "Searching for uid %d\n", usbuf->uid);
+ if (getpwuid_r(usbuf->uid, &pwd, pwd_buffer, sizeof pwd_buffer, &result) == 0) {
#endif // HAVE_GETPWUID_R
snprintf(buf, sizeof buf, "%s@%s", pwd.pw_name, config.c_fqdn);
vcard_add_prop(v, "email;internet", buf);
*/
void dvca_mime_callback(char *name, char *filename, char *partnum, char *disp,
void *content, char *cbtype, char *cbcharset, size_t length, char *encoding,
- void *cbuserdata) {
+ char *cbid, void *cbuserdata) {
struct vCard *v;
char displayname[256];