5 /* $ModDesc: Changes the ident of connecting bottler clients to 'bottler' */
7 class ModuleAntiBottler : public Module
18 virtual ~ModuleAntiBottler()
23 virtual Version GetVersion()
25 return Version(1,0,0,0);
29 virtual void OnServerRaw(std::string &raw, bool inbound)
34 strncpy(data,raw.c_str(),MAXBUF);
35 bool not_bottler = false;
36 if (!strncmp(data,"user ",5))
38 for (int j = 0; j < strlen(data); j++)
48 // Bug Fix (#14) -- FCS
49 if (!strlen(data)) break;
50 char *user = strtok(data," ");
51 if (!strlen(data)) break;
52 char *ident = strtok(NULL," ");
53 if (!strlen(data)) break;
54 char *local = strtok(NULL," ");
55 if (!strlen(data)) break;
56 char *remote = strtok(NULL," :");
57 if (!strlen(data)) break;
58 char *gecos = strtok(NULL,"\r\n");
59 for (int j = 0; j < strlen(remote); j++)
61 if (((remote[j] < '0') || (remote[j] > '9')) && (remote[j] != '.'))
69 raw = "USER bottler "+std::string(local)+" "+std::string(remote)+" "+std::string(gecos)+" [Possible bottler, ident: "+std::string(ident)+"]";
77 class ModuleAntiBottlerFactory : public ModuleFactory
80 ModuleAntiBottlerFactory()
84 ~ModuleAntiBottlerFactory()
88 virtual Module * CreateModule()
90 return new ModuleAntiBottler;
96 extern "C" void * init_module( void )
98 return new ModuleAntiBottlerFactory;