/*
- * $Id$
- *
* This module handles self-service subscription/unsubscription to mail lists.
*
- * Copyright (C) 2002-2005 by Art Cancro and others.
- * This code is released under the terms of the GNU General Public License.
+ * Copyright (c) 2002-2012 by the citadel.org team
*
+ * 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.
*/
#include "sysdep.h"
#include "citserver.h"
#include "support.h"
#include "config.h"
-#include "room_ops.h"
#include "user_ops.h"
-#include "policy.h"
#include "database.h"
#include "msgbase.h"
#include "internet_addressing.h"
#include "clientsocket.h"
#include "file_ops.h"
-
-#ifndef HAVE_SNPRINTF
-#include "snprintf.h"
-#endif
-
-
-
#include "ctdl_module.h"
-
/*
* Generate a randomizationalisticized token to use for authentication of
* a subscribe or unsubscribe request.
char scanemail[256];
int found_sub = 0;
- if (getroom(&qrbuf, room) != 0) {
+ if (CtdlGetRoom(&qrbuf, room) != 0) {
cprintf("%d There is no list called '%s'\n", ERROR + ROOM_NOT_FOUND, room);
return;
}
char scanemail[256];
int found_sub = 0;
- if (getroom(&qrbuf, room) != 0) {
+ if (CtdlGetRoom(&qrbuf, room) != 0) {
cprintf("%d There is no list called '%s'\n",
ERROR + ROOM_NOT_FOUND, room);
return;
int line_length;
char buf[512];
char cmd[256];
- char email[256];
+ char email[256] = "";
char subtype[128];
int success = 0;
- char address_to_unsubscribe[256];
+ char address_to_unsubscribe[256] = "";
char scancmd[256];
char scanemail[256];
char *holdbuf = NULL;
int linelen = 0;
int buflen = 0;
- strcpy(address_to_unsubscribe, "");
-
- if (getroom(&qrbuf, room) != 0) {
+ if (CtdlGetRoom(&qrbuf, room) != 0) {
cprintf("%d There is no list called '%s'\n",
ERROR + ROOM_NOT_FOUND, room);
return;
*/
if (success) {
cprintf("%d %d operation(s) confirmed.\n", CIT_OK, success);
- lprintf(CTDL_NOTICE,
+ syslog(LOG_NOTICE,
"Mailing list: %s %ssubscribed to %s with token %s\n",
email,
(!IsEmptyStr(address_to_unsubscribe)) ? "un" : "",
CtdlRegisterProtoHook(cmd_subs, "SUBS", "List subscribe/unsubscribe");
}
- /* return our Subversion id for the Log */
- return "$Id$";
+ /* return our module name for the log */
+ return "listsub";
}