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 cmd_setident : public command_t
23 cmd_setident (InspIRCd* Instance) : command_t(Instance,"SETIDENT", 'o', 1)
25 this->source = "m_setident.so";
26 syntax = "<new-ident>";
29 CmdResult Handle(const char** parameters, int pcnt, userrec *user)
33 user->WriteServ("NOTICE %s :*** SETIDENT: Ident must be specified", user->nick);
37 if (strlen(parameters[0]) > IDENTMAX)
39 user->WriteServ("NOTICE %s :*** SETIDENT: Ident is too long", user->nick);
43 if (!ServerInstance->IsIdent(parameters[0]))
45 user->WriteServ("NOTICE %s :*** SETIDENT: Invalid characters in ident", user->nick);
49 user->ChangeIdent(parameters[0]);
50 ServerInstance->WriteOpers("%s used SETIDENT to change their ident to '%s'", user->nick, user->ident);
57 class ModuleSetIdent : public Module
59 cmd_setident* mycommand;
62 ModuleSetIdent(InspIRCd* Me) : Module(Me)
65 mycommand = new cmd_setident(ServerInstance);
66 ServerInstance->AddCommand(mycommand);
69 virtual ~ModuleSetIdent()
73 virtual Version GetVersion()
75 return Version(1, 1, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
81 MODULE_INIT(ModuleSetIdent)