5 /* $ModDesc: Provides support for the SETIDENT command */
7 class cmd_setident : public command_t
10 cmd_setident (InspIRCd* Instance) : command_t(Instance,"SETIDENT", 'o', 1)
12 this->source = "m_setident.so";
13 syntax = "<new-ident>";
16 CmdResult Handle(const char** parameters, int pcnt, userrec *user)
18 for(unsigned int x = 0; x < strlen(parameters[0]); x++)
20 if(((parameters[0][x] >= 'A') && (parameters[0][x] <= '}')) || strchr(".-0123456789", parameters[0][x]))
23 user->WriteServ("NOTICE %s :*** Invalid characters in ident", user->nick);
27 user->ChangeIdent(parameters[0]);
28 ServerInstance->WriteOpers("%s used SETIDENT to change their ident to '%s'", user->nick, user->ident);
35 class ModuleSetIdent : public Module
37 cmd_setident* mycommand;
40 ModuleSetIdent(InspIRCd* Me) : Module::Module(Me)
43 mycommand = new cmd_setident(ServerInstance);
44 ServerInstance->AddCommand(mycommand);
47 virtual ~ModuleSetIdent()
51 virtual Version GetVersion()
53 return Version(1,0,0,0,VF_VENDOR,API_VERSION);
58 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
60 class ModuleSetIdentFactory : public ModuleFactory
63 ModuleSetIdentFactory()
67 ~ModuleSetIdentFactory()
71 virtual Module * CreateModule(InspIRCd* Me)
73 return new ModuleSetIdent(Me);
79 extern "C" void * init_module( void )
81 return new ModuleSetIdentFactory;