*/
#include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
-#include "hashcomp.h"
/* $ModDesc: Provides the NICKLOCK command, allows an oper to chage a users nick and lock them to it until they quit */
{
this->source = "m_nicklock.so";
syntax = "<oldnick> <newnick>";
+ TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
}
CmdResult Handle(const char** parameters, int pcnt, userrec *user)
{
// ugh, nickchange failed for some reason -- possibly existing nick?
userrec::QuitUser(ServerInstance, source, "Nickname collision");
- return CMD_FAILURE;
}
// give them a lock flag
virtual int OnUserPreNick(userrec* user, const std::string &newnick)
{
+ if (isdigit(newnick[0])) /* allow a switch to a UID */
+ return 0;
+
if (user->GetExt("nick_locked", n))
{
user->WriteServ("447 %s :You cannot change your nickname (your nick is locked)",user->nick);