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 SETIDENT command */
22 class cmd_setident : public command_t
25 cmd_setident (InspIRCd* Instance) : command_t(Instance,"SETIDENT", 'o', 1)
27 this->source = "m_setident.so";
28 syntax = "<new-ident>";
31 CmdResult Handle(const char** parameters, int pcnt, userrec *user)
34 for(const char* x = parameters[0]; *x; x++, len++)
36 if(((*x >= 'A') && (*x <= '}')) || strchr(".-0123456789", *x))
39 user->WriteServ("NOTICE %s :*** Invalid characters in ident", user->nick);
44 user->WriteServ("NOTICE %s :*** SETIDENT: Ident too short", user->nick);
49 user->WriteServ("NOTICE %s :*** Ident is too long", user->nick);
53 user->ChangeIdent(parameters[0]);
54 ServerInstance->WriteOpers("%s used SETIDENT to change their ident to '%s'", user->nick, user->ident);
61 class ModuleSetIdent : public Module
63 cmd_setident* mycommand;
66 ModuleSetIdent(InspIRCd* Me) : Module(Me)
69 mycommand = new cmd_setident(ServerInstance);
70 ServerInstance->AddCommand(mycommand);
73 virtual ~ModuleSetIdent()
77 virtual Version GetVersion()
79 return Version(1,1,0,0,VF_VENDOR,API_VERSION);
85 MODULE_INIT(ModuleSetIdent);