1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
18 /* $ModDesc: Provides support for the SETIDENT command */
22 class cmd_setident : public command_t
25 cmd_setident (InspIRCd* Instance) : command_t(Instance,"SETIDENT", 'o', 1)
27 this->source = "m_setident.so";
28 syntax = "<new-ident>";
31 CmdResult Handle(const char** parameters, int pcnt, userrec *user)
34 for(const char* x = parameters[0]; *x; x++, len++)
36 if(((*x >= 'A') && (*x <= '}')) || strchr(".-0123456789", *x))
39 user->WriteServ("NOTICE %s :*** Invalid characters in ident", user->nick);
44 user->WriteServ("NOTICE %s :*** Ident is too long", user->nick);
48 user->ChangeIdent(parameters[0]);
49 ServerInstance->WriteOpers("%s used SETIDENT to change their ident to '%s'", user->nick, user->ident);
56 class ModuleSetIdent : public Module
58 cmd_setident* mycommand;
61 ModuleSetIdent(InspIRCd* Me) : Module(Me)
64 mycommand = new cmd_setident(ServerInstance);
65 ServerInstance->AddCommand(mycommand);
68 virtual ~ModuleSetIdent()
72 virtual Version GetVersion()
74 return Version(1,1,0,0,VF_VENDOR,API_VERSION);
79 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
81 class ModuleSetIdentFactory : public ModuleFactory
84 ModuleSetIdentFactory()
88 ~ModuleSetIdentFactory()
92 virtual Module * CreateModule(InspIRCd* Me)
94 return new ModuleSetIdent(Me);
100 extern "C" DllExport void * init_module( void )
102 return new ModuleSetIdentFactory;