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 * ---------------------------------------------------
16 /* $ModDesc: Provides support for the SETIDENT command */
20 class CommandSetident : public Command
23 CommandSetident (InspIRCd* Instance) : Command(Instance,"SETIDENT", 'o', 1)
25 this->source = "m_setident.so";
26 syntax = "<new-ident>";
27 TRANSLATE2(TR_TEXT, TR_END);
30 CmdResult Handle(const char** parameters, int pcnt, User *user)
34 user->WriteServ("NOTICE %s :*** SETIDENT: Ident must be specified", user->nick);
38 if (strlen(parameters[0]) > IDENTMAX)
40 user->WriteServ("NOTICE %s :*** SETIDENT: Ident is too long", user->nick);
44 if (!ServerInstance->IsIdent(parameters[0]))
46 user->WriteServ("NOTICE %s :*** SETIDENT: Invalid characters in ident", user->nick);
50 user->ChangeIdent(parameters[0]);
51 ServerInstance->WriteOpers("%s used SETIDENT to change their ident to '%s'", user->nick, user->ident);
58 class ModuleSetIdent : public Module
60 CommandSetident* mycommand;
63 ModuleSetIdent(InspIRCd* Me) : Module(Me)
66 mycommand = new CommandSetident(ServerInstance);
67 ServerInstance->AddCommand(mycommand);
71 virtual ~ModuleSetIdent()
75 virtual Version GetVersion()
77 return Version(1, 1, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
83 MODULE_INIT(ModuleSetIdent)