Removed the logging facility from citserver, use syslog instead
[citadel.git] / citadel / modules / listsub / serv_listsub.c
index 615bcc5b59685ed6ae7f9af456714d819b4d4b4e..3ad989ab579a4da38e1a20db5059614ca18525a2 100644 (file)
@@ -1,10 +1,21 @@
 /*
- * $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-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 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
  *
  */
 
@@ -39,9 +50,7 @@
 #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"
@@ -93,7 +102,7 @@ void do_subscribe(char *room, char *email, char *subtype, char *webpage) {
        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;
        }
@@ -156,7 +165,7 @@ void do_subscribe(char *room, char *email, char *subtype, char *webpage) {
 
        /* Generate and send the confirmation request */
 
-       urlesc(urlroom, qrbuf.QRname);
+       urlesc(urlroom, ROOMNAMELEN, qrbuf.QRname);
 
        snprintf(confirmation_request, sizeof confirmation_request,
 
@@ -233,7 +242,7 @@ void do_unsubscribe(char *room, char *email, char *webpage) {
        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;
@@ -296,7 +305,7 @@ void do_unsubscribe(char *room, char *email, char *webpage) {
 
        /* Generate and send the confirmation request */
 
-       urlesc(urlroom, qrbuf.QRname);
+       urlesc(urlroom, ROOMNAMELEN, qrbuf.QRname);
 
        snprintf(confirmation_request, sizeof confirmation_request,
 
@@ -382,7 +391,7 @@ void do_confirm(char *room, char *token) {
 
        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;
@@ -506,7 +515,7 @@ void do_confirm(char *room, char *token) {
         */
        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" : "", 
@@ -576,5 +585,5 @@ CTDL_MODULE_INIT(listsub)
        }
        
        /* return our Subversion id for the Log */
-       return "$Id$";
+       return "listsub";
 }