* 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
+ * Copyright (c) 1999-2012 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 open source software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3.
+ *
+ *
*
* 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
+ *
+ *
+ *
*/
/*
* Bail out silently without saving.
*/
syslog(LOG_DEBUG, "DOOP!\n");
- StrBufAppendBufPlain(CCC->StatusMessage, _("unable to add this emailaddress again."), -1, 0);
- StrBufAppendBufPlain(CCC->StatusMessage, HKEY("|"), 0);
+
+ StrBufAppendPrintf(CCC->StatusMessage, "\n%d|", ERROR+ALREADY_EXISTS);
StrBufAppendBufPlain(CCC->StatusMessage, internet_addr, -1, 0);
StrBufAppendBufPlain(CCC->StatusMessage, HKEY("|"), 0);
+ StrBufAppendBufPlain(CCC->StatusMessage, _("unable to add this emailaddress again."), -1, 0);
+ StrBufAppendBufPlain(CCC->StatusMessage, HKEY("\n"), 0);
return 0;
}
}
syslog(LOG_INFO, "Adding %s (%s) to directory\n", citadel_addr, internet_addr);
if (CtdlDirectoryAddUser(internet_addr, citadel_addr))
{
- StrBufAppendBufPlain(CCC->StatusMessage, _("successfully addded emailaddress."), -1, 0);
- StrBufAppendBufPlain(CCC->StatusMessage, HKEY("|"), 0);
+ StrBufAppendPrintf(CCC->StatusMessage, "\n%d|", CIT_OK);
StrBufAppendBufPlain(CCC->StatusMessage, internet_addr, -1, 0);
StrBufAppendBufPlain(CCC->StatusMessage, HKEY("|"), 0);
+ StrBufAppendBufPlain(CCC->StatusMessage, _("successfully addded emailaddress."), -1, 0);
return 1;
}
else
{
- StrBufAppendBufPlain(CCC->StatusMessage, _("unable to add this emailaddress; its not matching our domain."), -1, 0);
- StrBufAppendBufPlain(CCC->StatusMessage, HKEY("|"), 0);
+ StrBufAppendPrintf(CCC->StatusMessage, "\n%d|", ERROR+ ILLEGAL_VALUE);
StrBufAppendBufPlain(CCC->StatusMessage, internet_addr, -1, 0);
StrBufAppendBufPlain(CCC->StatusMessage, HKEY("|"), 0);
+ StrBufAppendBufPlain(CCC->StatusMessage, _("unable to add this emailaddress; its not matching our domain."), -1, 0);
return 0;
}
}
}
if (!IsDirectoryAddress && local_addrs_only)
{
- StrBufAppendBufPlain(CCC->StatusMessage,
- _("unable to add this emailaddress; its not matching our domain."), -1, 0);
- StrBufAppendBufPlain(CCC->StatusMessage, HKEY("|"), 0);
+ StrBufAppendPrintf(CCC->StatusMessage, "\n%d|", ERROR+ ILLEGAL_VALUE);
StrBufAppendBufPlain(CCC->StatusMessage, addr, -1, 0);
StrBufAppendBufPlain(CCC->StatusMessage, HKEY("|"), 0);
+ StrBufAppendBufPlain(CCC->StatusMessage, _("unable to add this emailaddress; its not matching our domain."), -1, 0);
}
}
free(addr);
}
s = vcard_get_prop(v, "fn", 1, 0, 0);
- if (s) syslog(LOG_DEBUG, "vCard beforesave hook running for <%s>\n", s);
if (yes_my_citadel_config) {
/* Bingo! The user is uploading a new vCard, so
NewStrBufDupAppendFlush(&CC->StatusMessage, NULL, NULL, 0);
+ StrBufPrintf(CC->StatusMessage, "%d\n", LISTING_FOLLOWS);
+
while (ptr != NULL) {
linelen = strcspn(ptr, "\n");
* copy it to the Global Address Book room.
*/
- I = atol(msg->cm_fields['I']);
- if (I < 0L) return(0);
+ I = atol(msg->cm_fields['3']);
+ if (I <= 0L) return(0);
/* Store our Internet return address in memory */
if (is_MY_UserConf) {
char *cbid, void *cbuserdata) {
struct vCard *v;
- char displayname[256];
+ char displayname[256] = "";
int displayname_len;
- char emailaddr[256];
+ char emailaddr[256] = "";
int i;
int has_commas = 0;