]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/vcard/serv_vcard.c
* added a.n.o patches for solaris compatibility
[citadel.git] / citadel / modules / vcard / serv_vcard.c
index 7180cd668229ebb623a37b71dd5667fbb5cd429b..2f126f40852b3cae4e2e44225c715c6f1ab26064 100644 (file)
@@ -714,8 +714,13 @@ int vcard_upload_aftersave(struct CtdlMessage *msg) {
                        vcard_add_to_directory(I, NULL);
 
                        /* Some sites want an Aide to be notified when a
-                        * user registers or re-registers...
+                        * user registers or re-registers
+                        * 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)
+                               return (0);
+                       
                        set_mm_valid();
 
                        /* ...which also means we need to flag the user */
@@ -991,10 +996,14 @@ void vcard_newuser(struct ctdluser *usbuf) {
        /* If using host auth mode, we add an email address based on the login */
        if (config.c_auth_mode == AUTHMODE_HOST) {
                struct passwd pwd;
-               struct passwd **result = NULL;
                char pwd_buffer[SIZ];
-
+               
+#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) {
+#endif // HAVE_GETPWUID_R
                        snprintf(buf, sizeof buf, "%s@%s", pwd.pw_name, config.c_fqdn);
                        vcard_add_prop(v, "email;internet", buf);
                }
@@ -1041,7 +1050,7 @@ void vcard_purge(struct ctdluser *usbuf) {
 
        msg->cm_fields['S'] = strdup("CANCEL");
 
-       CtdlSubmitMsg(msg, NULL, ADDRESS_BOOK_ROOM);
+       CtdlSubmitMsg(msg, NULL, ADDRESS_BOOK_ROOM, QP_EADDR);
        CtdlFreeMessage(msg);
 }
 
@@ -1482,7 +1491,7 @@ void store_this_ha(struct addresses_to_be_filed *aptr) {
                        vcard_free(v);
 
                        CtdlLogPrintf(CTDL_DEBUG, "Adding contact: %s\n", recipient);
-                       vmsgnum = CtdlSubmitMsg(vmsg, NULL, aptr->roomname);
+                       vmsgnum = CtdlSubmitMsg(vmsg, NULL, aptr->roomname, QP_EADDR);
                        CtdlFreeMessage(vmsg);
                }
        }