Remove cruft left behind by removed stats_p_hook.
[seven-1.x.git] / modules / m_unreject.c
blob0729dcd7dd59e752543a4b2d707dd277f5c2c86d
1 /*
2 * ircd-ratbox: A slightly useful ircd.
3 * m_unreject.c: Removes an ip from the reject cache
5 * Copyright (C) 2004 Aaron Sethman <androsyn@ratbox.org>
6 * Copyright (C) 2004-2005 ircd-ratbox development team
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 * USA
24 #include "stdinc.h"
25 #include "client.h"
26 #include "s_conf.h"
27 #include "hostmask.h"
28 #include "reject.h"
29 #include "msg.h"
30 #include "modules.h"
31 #include "send.h"
33 static int mo_unreject(struct Client *, struct Client *, int, const char **);
35 struct Message unreject_msgtab = {
36 "UNREJECT", 0, 0, 0, MFLG_SLOW,
37 {mg_unreg, mg_not_oper, mg_ignore, mg_ignore, mg_ignore, {mo_unreject, 2}}
40 mapi_clist_av1 unreject_clist[] = { &unreject_msgtab, NULL };
41 DECLARE_MODULE_AV1(unreject, NULL, NULL, unreject_clist, NULL, NULL, "$Revision: 147 $");
44 * mo_unreject
47 static int
48 mo_unreject(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
50 if(!IsOperUnkline(source_p))
52 sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "unkline");
53 return 0;
56 if(ConfigFileEntry.reject_after_count == 0 || ConfigFileEntry.reject_ban_time == 0 ||
57 ConfigFileEntry.reject_duration == 0)
59 sendto_one(source_p, ":%s NOTICE %s :Reject cache is disabled",
60 me.name, source_p->name);
61 return 0;
64 if(!parse_netmask(parv[1], NULL, NULL))
66 sendto_one(source_p, ":%s NOTICE %s :Unable to parse netmask %s",
67 me.name, source_p->name, parv[1]);
68 return 0;
71 if(remove_reject(parv[1]))
72 sendto_one(source_p, ":%s NOTICE %s :Removed reject for %s",
73 me.name, source_p->name, parv[1]);
74 else
75 sendto_one(source_p, ":%s NOTICE %s :Unable to remove reject for %s",
76 me.name, source_p->name, parv[1]);
77 return 0;