]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_antibear.cpp
Fixed a bug in m_connflood that caused the bootwait value to have no effect
[user/henk/code/inspircd.git] / src / modules / m_antibear.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
6  * See: http://www.inspircd.org/wiki/index.php/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #include "users.h"
15 #include "channels.h"
16 #include "modules.h"
17
18
19 /* $ModDesc: Sends a numeric on connect which cripples a common type of trojan/spambot */
20
21 class ModuleAntiBear : public Module
22 {
23  private:
24
25  public:
26         ModuleAntiBear(InspIRCd* Me) : Module::Module(Me)
27         {
28                 
29         }
30         
31         virtual ~ModuleAntiBear()
32         {
33         }
34         
35         virtual Version GetVersion()
36         {
37                 return Version(1,1,0,0,VF_VENDOR,API_VERSION);
38         }
39
40         void Implements(char* List)
41         {
42                 List[I_OnUserRegister] = 1;
43         }
44         
45         virtual int OnUserRegister(userrec* user)
46         {
47                 user->WriteServ("439 %s :This server has anti-spambot mechanisms enabled.", user->nick);
48                 user->WriteServ("931 %s :Malicious bots, spammers, and other automated systems of dubious origin are NOT welcome here.", user->nick);
49                 return 0;
50         }
51 };
52
53 class ModuleAntiBearFactory : public ModuleFactory
54 {
55  public:
56         ModuleAntiBearFactory()
57         {
58         }
59         
60         ~ModuleAntiBearFactory()
61         {
62         }
63         
64         virtual Module * CreateModule(InspIRCd* Me)
65         {
66                 return new ModuleAntiBear(Me);
67         }
68         
69 };
70
71
72 //
73 // The "C" linkage factory0() function creates the ModuleAntiBearFactory
74 // class for this library
75 //
76
77 extern "C" void * init_module( void )
78 {
79         return new ModuleAntiBearFactory;
80 }