3 #include "helperfuncs.h"
5 /* $ModDesc: Provides support for the SETIDENT command */
9 class cmd_setident : public command_t
12 cmd_setident() : command_t("SETIDENT", 'o', 1)
14 this->source = "m_setident.so";
17 void Handle(const char** parameters, int pcnt, userrec *user)
19 for(unsigned int x = 0; x < strlen(parameters[0]); x++)
21 if(((parameters[0][x] >= 'A') && (parameters[0][x] <= '}')) || strchr(".-0123456789", parameters[0][x]))
24 WriteServ(user->fd, "NOTICE %s :*** Invalid characters in ident", user->nick);
28 WriteOpers("%s used SETIDENT to change their ident from '%s' to '%s'", user->nick, user->ident, parameters[0]);
29 strlcpy(user->ident, parameters[0], IDENTMAX+2);
34 class ModuleSetIdent : public Module
36 cmd_setident* mycommand;
39 ModuleSetIdent(Server* Me) : Module::Module(Me)
42 mycommand = new cmd_setident();
43 Srv->AddCommand(mycommand);
46 virtual ~ModuleSetIdent()
50 virtual Version GetVersion()
52 return Version(1,0,0,0,VF_VENDOR);
57 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
59 class ModuleSetIdentFactory : public ModuleFactory
62 ModuleSetIdentFactory()
66 ~ModuleSetIdentFactory()
70 virtual Module * CreateModule(Server* Me)
72 return new ModuleSetIdent(Me);
78 extern "C" void * init_module( void )
80 return new ModuleSetIdentFactory;