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 CHGIDENT command */
22 class cmd_chgident : public command_t
25 cmd_chgident (InspIRCd* Instance) : command_t(Instance,"CHGIDENT", 'o', 2)
27 this->source = "m_chgident.so";
28 syntax = "<nick> <newident>";
31 CmdResult Handle(const char** parameters, int pcnt, userrec *user)
33 userrec* dest = ServerInstance->FindNick(parameters[0]);
37 user->WriteServ("401 %s %s :No such nick/channel", user->nick, parameters[0]);
41 if(!ServerInstance->IsIdent(parameters[1]))
43 user->WriteServ("NOTICE %s :*** Invalid characters in ident", user->nick);
47 dest->ChangeIdent(parameters[1]);
48 ServerInstance->WriteOpers("%s used CHGIDENT to change %s's ident to '%s'", user->nick, dest->nick, dest->ident);
56 class ModuleChgIdent : public Module
58 cmd_chgident* mycommand;
62 ModuleChgIdent(InspIRCd* Me) : Module(Me)
64 mycommand = new cmd_chgident(ServerInstance);
65 ServerInstance->AddCommand(mycommand);
68 virtual ~ModuleChgIdent()
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 ModuleChgIdentFactory : public ModuleFactory
84 ModuleChgIdentFactory()
88 ~ModuleChgIdentFactory()
92 virtual Module * CreateModule(InspIRCd* Me)
94 return new ModuleChgIdent(Me);
100 extern "C" DllExport void * init_module( void )
102 return new ModuleChgIdentFactory;