* A server-side module for Citadel which supports address book information
* using the standard vCard format.
*
* Copyright (c) 1999-2009 by the citadel.org team
*
* A server-side module for Citadel which supports address book information
* using the standard vCard format.
*
* Copyright (c) 1999-2009 by the citadel.org team
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
if (CtdlDirectoryLookup(buf, internet_addr, sizeof buf) == 0) {
if (strcasecmp(buf, citadel_addr)) {
/* This address belongs to someone else.
* Bail out silently without saving.
*/
if (CtdlDirectoryLookup(buf, internet_addr, sizeof buf) == 0) {
if (strcasecmp(buf, citadel_addr)) {
/* This address belongs to someone else.
* Bail out silently without saving.
*/
- CtdlLogPrintf(CTDL_INFO, "Adding %s (%s) to directory\n", citadel_addr, internet_addr);
+ syslog(LOG_INFO, "Adding %s (%s) to directory\n", citadel_addr, internet_addr);
- CtdlForEachMessage(MSGS_ALL, 0, NULL, "^[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$",
+ CtdlForEachMessage(MSGS_ALL, 0, NULL, "[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$",
NULL, vcard_add_to_directory, NULL);
CtdlGetRoom(&CC->room, hold_rm); /* return to saved room */
NULL, vcard_add_to_directory, NULL);
CtdlGetRoom(&CC->room, hold_rm); /* return to saved room */
if ( (!strcasecmp(cbtype, "text/x-vcard"))
|| (!strcasecmp(cbtype, "text/vcard")) ) {
if ( (!strcasecmp(cbtype, "text/x-vcard"))
|| (!strcasecmp(cbtype, "text/vcard")) ) {
}
s = vcard_get_prop(v, "fn", 1, 0, 0);
}
s = vcard_get_prop(v, "fn", 1, 0, 0);
if (yes_my_citadel_config) {
/* Bingo! The user is uploading a new vCard, so
if (yes_my_citadel_config) {
/* Bingo! The user is uploading a new vCard, so
- CtdlDeleteMessages(CC->room.QRname, NULL, 0, "^[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$");
+ CtdlDeleteMessages(CC->room.QRname, NULL, 0, "[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$");
- CtdlForEachMessage(MSGS_LAST, 1, NULL, "^[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$",
+ CtdlForEachMessage(MSGS_LAST, 1, NULL, "[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$",
NULL, vcard_gu_backend, (void *)&VCmsgnum );
CtdlGetRoom(&CC->room, hold_rm); /* return to saved room */
NULL, vcard_gu_backend, (void *)&VCmsgnum );
CtdlGetRoom(&CC->room, hold_rm); /* return to saved room */
- CtdlLogPrintf(CTDL_DEBUG, "Converted <%s> to <%s>\n", usbuf->fullname, vname);
+ syslog(LOG_DEBUG, "Converted <%s> to <%s>\n", usbuf->fullname, vname);
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) != 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);
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);
time(&CC->lastcmd);
memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
if (client_getln(cmdbuf, sizeof cmdbuf) < 1) {
time(&CC->lastcmd);
memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
if (client_getln(cmdbuf, sizeof cmdbuf) < 1) {
/* Create the calendar room if it doesn't already exist */
CtdlCreateRoom(USERCONTACTSROOM, 4, "", 0, 1, 0, VIEW_ADDRESSBOOK);
/* Set expiration policy to manual; otherwise objects will be lost! */
if (CtdlGetRoomLock(&qr, USERCONTACTSROOM)) {
/* Create the calendar room if it doesn't already exist */
CtdlCreateRoom(USERCONTACTSROOM, 4, "", 0, 1, 0, VIEW_ADDRESSBOOK);
/* Set expiration policy to manual; otherwise objects will be lost! */
if (CtdlGetRoomLock(&qr, USERCONTACTSROOM)) {
/* First remove any addresses we already have in the address book */
CtdlUserGoto(aptr->roomname, 0, 0, NULL, NULL);
/* First remove any addresses we already have in the address book */
CtdlUserGoto(aptr->roomname, 0, 0, NULL, NULL);
- CtdlForEachMessage(MSGS_ALL, 0, NULL, "^[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$", NULL,
+ CtdlForEachMessage(MSGS_ALL, 0, NULL, "[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$", NULL,
strip_addresses_already_have, aptr->collected_addresses);
if (!IsEmptyStr(aptr->collected_addresses))
strip_addresses_already_have, aptr->collected_addresses);
if (!IsEmptyStr(aptr->collected_addresses))
- CtdlLogPrintf(CTDL_DEBUG, "Adding contact: %s\n", recipient);
- vmsgnum = CtdlSubmitMsg(vmsg, NULL, aptr->roomname, QP_EADDR);
+ syslog(LOG_DEBUG, "Adding contact: %s\n", recipient);
+ CtdlSubmitMsg(vmsg, NULL, aptr->roomname, QP_EADDR);
fp = fopen(filename, "a");
if (fp != NULL) fclose(fp);
rv = chown(filename, CTDLUID, (-1));
fp = fopen(filename, "a");
if (fp != NULL) fclose(fp);
rv = chown(filename, CTDLUID, (-1));