* More license declarations
[citadel.git] / citadel / modules / netfilter / serv_netfilter.c
index 31fced57ba0b4a543b82990ead58068a291e540d..cf5e756a7baae7c8d0a9623191fc281e059e0120 100644 (file)
@@ -3,7 +3,21 @@
  * 
  * A server-side module for Citadel designed to filter idiots off the network.
  * 
- * Copyright (c) 2002 / released under 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
  */
 
 #include "sysdep.h"
@@ -30,6 +44,7 @@
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
+#include <libcitadel.h>
 #include "citadel.h"
 #include "server.h"
 #include "citserver.h"
@@ -41,8 +56,7 @@
 #include "policy.h"
 #include "database.h"
 #include "msgbase.h"
-#include "serv_network.h"
-#include "tools.h"
+#include "serv_network.h"      /* Needed for defenition of FilterList */
 
 
 #include "ctdl_module.h"
@@ -54,7 +68,7 @@
  * is found, the message is rejected.
  */
 int filter_the_idiots(struct CtdlMessage *msg, char *target_room) {
-       struct FilterList *fptr;
+       FilterList *fptr;
        int zap_user = 0;
        int zap_room = 0;
        int zap_node = 0;
@@ -107,8 +121,11 @@ int filter_the_idiots(struct CtdlMessage *msg, char *target_room) {
 
 CTDL_MODULE_INIT(netfilter)
 {
-       CtdlRegisterNetprocHook(filter_the_idiots);
-
+       if (!threading)
+       {
+               CtdlRegisterNetprocHook(filter_the_idiots);
+       }
+       
        /* return our Subversion id for the Log */
        return "$Id$";
 }