1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2010 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/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(Module* Creator) : Command(Creator,"SETIDENT", 1)
25 flags_needed = 'o'; syntax = "<new-ident>";
26 TRANSLATE2(TR_TEXT, TR_END);
29 CmdResult Handle(const std::vector<std::string>& parameters, User *user)
31 if (parameters.size() == 0)
33 user->WriteServ("NOTICE %s :*** SETIDENT: Ident must be specified", user->nick.c_str());
37 if (parameters[0].size() > ServerInstance->Config->Limits.IdentMax)
39 user->WriteServ("NOTICE %s :*** SETIDENT: Ident is too long", user->nick.c_str());
43 if (!ServerInstance->IsIdent(parameters[0].c_str()))
45 user->WriteServ("NOTICE %s :*** SETIDENT: Invalid characters in ident", user->nick.c_str());
49 user->ChangeIdent(parameters[0].c_str());
50 ServerInstance->SNO->WriteGlobalSno('a', "%s used SETIDENT to change their ident to '%s'", user->nick.c_str(), user->ident.c_str());
57 class ModuleSetIdent : public Module
62 ModuleSetIdent() : cmd(this)
64 ServerInstance->AddCommand(&cmd);
67 virtual ~ModuleSetIdent()
71 virtual Version GetVersion()
73 return Version("Provides support for the SETIDENT command", VF_VENDOR);
79 MODULE_INIT(ModuleSetIdent)