6 /* $ModDesc: Provides support for the SETIDENT command */
11 class cmd_setident : public command_t
14 cmd_setident (InspIRCd* Instance) : command_t(Instance,"SETIDENT", 'o', 1)
16 this->source = "m_setident.so";
17 syntax = "<new-ident>";
20 CmdResult Handle(const char** parameters, int pcnt, userrec *user)
22 for(unsigned int x = 0; x < strlen(parameters[0]); x++)
24 if(((parameters[0][x] >= 'A') && (parameters[0][x] <= '}')) || strchr(".-0123456789", parameters[0][x]))
27 user->WriteServ("NOTICE %s :*** Invalid characters in ident", user->nick);
31 user->ChangeIdent(parameters[0]);
32 ServerInstance->WriteOpers("%s used SETIDENT to change their ident to '%s'", user->nick, user->ident);
39 class ModuleSetIdent : public Module
41 cmd_setident* mycommand;
44 ModuleSetIdent(InspIRCd* Me) : Module::Module(Me)
47 mycommand = new cmd_setident(ServerInstance);
48 ServerInstance->AddCommand(mycommand);
51 virtual ~ModuleSetIdent()
55 virtual Version GetVersion()
57 return Version(1,0,0,0,VF_VENDOR);
62 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
64 class ModuleSetIdentFactory : public ModuleFactory
67 ModuleSetIdentFactory()
71 ~ModuleSetIdentFactory()
75 virtual Module * CreateModule(InspIRCd* Me)
77 return new ModuleSetIdent(Me);
83 extern "C" void * init_module( void )
85 return new ModuleSetIdentFactory;