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]);
43 user->WriteServ("NOTICE %s :*** CHGIDENT: Ident must be specified", user->nick);
47 if (strlen(parameters[1]) > IDENTMAX)
49 user->WriteServ("NOTICE %s :*** CHGIDENT: Ident is too long", user->nick);
53 if (!ServerInstance->IsIdent(parameters[1]))
55 user->WriteServ("NOTICE %s :*** CHGIDENT: Invalid characters in ident", user->nick);
59 dest->ChangeIdent(parameters[1]);
60 ServerInstance->WriteOpers("%s used CHGIDENT to change %s's ident to '%s'", user->nick, dest->nick, dest->ident);
68 class ModuleChgIdent : public Module
70 cmd_chgident* mycommand;
74 ModuleChgIdent(InspIRCd* Me) : Module(Me)
76 mycommand = new cmd_chgident(ServerInstance);
77 ServerInstance->AddCommand(mycommand);
80 virtual ~ModuleChgIdent()
84 virtual Version GetVersion()
86 return Version(1,1,0,0,VF_VENDOR,API_VERSION);
91 MODULE_INIT(ModuleChgIdent)