mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-12 03:59:03 -04:00
Allow eline/gline/kline/zline by nick
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8553 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
b94c45340e
commit
945a558759
@ -26,7 +26,16 @@ CmdResult CommandEline::Handle (const char** parameters, int pcnt, User *user)
|
||||
{
|
||||
if (pcnt >= 3)
|
||||
{
|
||||
IdentHostPair ih = ServerInstance->XLines->IdentSplit(parameters[0]);
|
||||
IdentHostPair ih;
|
||||
User* find = ServerInstance->FindNick(parameters[0]);
|
||||
if (find)
|
||||
{
|
||||
ih.first = "*";
|
||||
ih.second = find->GetIPString();
|
||||
}
|
||||
else
|
||||
ih = ServerInstance->XLines->IdentSplit(parameters[0]);
|
||||
|
||||
if (ServerInstance->HostMatchesEveryone(ih.first+"@"+ih.second,user))
|
||||
return CMD_FAILURE;
|
||||
|
||||
|
@ -26,7 +26,16 @@ CmdResult CommandGline::Handle (const char** parameters, int pcnt, User *user)
|
||||
{
|
||||
if (pcnt >= 3)
|
||||
{
|
||||
IdentHostPair ih = ServerInstance->XLines->IdentSplit(parameters[0]);
|
||||
IdentHostPair ih;
|
||||
User* find = ServerInstance->FindNick(parameters[0]);
|
||||
if (find)
|
||||
{
|
||||
ih.first = "*";
|
||||
ih.second = find->GetIPString();
|
||||
}
|
||||
else
|
||||
ih = ServerInstance->XLines->IdentSplit(parameters[0]);
|
||||
|
||||
if (ServerInstance->HostMatchesEveryone(ih.first+"@"+ih.second,user))
|
||||
return CMD_FAILURE;
|
||||
|
||||
|
@ -26,7 +26,16 @@ CmdResult CommandKline::Handle (const char** parameters, int pcnt, User *user)
|
||||
{
|
||||
if (pcnt >= 3)
|
||||
{
|
||||
IdentHostPair ih = ServerInstance->XLines->IdentSplit(parameters[0]);
|
||||
IdentHostPair ih;
|
||||
User* find = ServerInstance->FindNick(parameters[0]);
|
||||
if (find)
|
||||
{
|
||||
ih.first = "*";
|
||||
ih.second = find->GetIPString();
|
||||
}
|
||||
else
|
||||
ih = ServerInstance->XLines->IdentSplit(parameters[0]);
|
||||
|
||||
if (ServerInstance->HostMatchesEveryone(ih.first+"@"+ih.second,user))
|
||||
return CMD_FAILURE;
|
||||
|
||||
|
@ -38,12 +38,21 @@ CmdResult CommandZline::Handle (const char** parameters, int pcnt, User *user)
|
||||
long duration = ServerInstance->Duration(parameters[1]);
|
||||
|
||||
const char* ipaddr = parameters[0];
|
||||
User* find = ServerInstance->FindNick(parameters[0]);
|
||||
|
||||
if (find)
|
||||
{
|
||||
ipaddr = find->GetIPString();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strchr(ipaddr,'@'))
|
||||
{
|
||||
while (*ipaddr != '@')
|
||||
ipaddr++;
|
||||
ipaddr++;
|
||||
}
|
||||
}
|
||||
ZLine* zl = new ZLine(ServerInstance, ServerInstance->Time(), duration, user->nick, parameters[2], ipaddr);
|
||||
if (ServerInstance->XLines->AddLine(zl,user))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user