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 * ---------------------------------------------------
19 /* $ModDesc: Provides support for the CHGIDENT command */
23 class cmd_chgident : public command_t
26 cmd_chgident (InspIRCd* Instance) : command_t(Instance,"CHGIDENT", 'o', 2)
28 this->source = "m_chgident.so";
29 syntax = "<nick> <newident>";
32 CmdResult Handle(const char** parameters, int pcnt, userrec *user)
34 userrec* dest = ServerInstance->FindNick(parameters[0]);
38 if(!ServerInstance->IsIdent(parameters[1]))
40 user->WriteServ("NOTICE %s :*** Invalid characters in ident", user->nick);
44 dest->ChangeIdent(parameters[1]);
45 ServerInstance->WriteOpers("%s used CHGIDENT to change %s's ident to '%s'", user->nick, dest->nick, dest->ident);
50 user->WriteServ("401 %s %s :No such nick/channel", user->nick, parameters[0]);
57 class ModuleChgIdent : public Module
59 cmd_chgident* mycommand;
63 ModuleChgIdent(InspIRCd* Me) : Module::Module(Me)
65 mycommand = new cmd_chgident(ServerInstance);
66 ServerInstance->AddCommand(mycommand);
69 virtual ~ModuleChgIdent()
73 virtual Version GetVersion()
75 return Version(1,1,0,0,VF_VENDOR,API_VERSION);
80 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
82 class ModuleChgIdentFactory : public ModuleFactory
85 ModuleChgIdentFactory()
89 ~ModuleChgIdentFactory()
93 virtual Module * CreateModule(InspIRCd* Me)
95 return new ModuleChgIdent(Me);
101 extern "C" void * init_module( void )
103 return new ModuleChgIdentFactory;