mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-11 19:49:02 -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
@ -6,7 +6,7 @@
|
||||
* See: http://www.inspircd.org/wiki/index.php/Credits
|
||||
*
|
||||
* This program is free but copyrighted software; see
|
||||
* the file COPYING for details.
|
||||
* the file COPYING for details.
|
||||
*
|
||||
* ---------------------------------------------------
|
||||
*/
|
||||
@ -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;
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* See: http://www.inspircd.org/wiki/index.php/Credits
|
||||
*
|
||||
* This program is free but copyrighted software; see
|
||||
* the file COPYING for details.
|
||||
* the file COPYING for details.
|
||||
*
|
||||
* ---------------------------------------------------
|
||||
*/
|
||||
@ -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;
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* See: http://www.inspircd.org/wiki/index.php/Credits
|
||||
*
|
||||
* This program is free but copyrighted software; see
|
||||
* the file COPYING for details.
|
||||
* the file COPYING for details.
|
||||
*
|
||||
* ---------------------------------------------------
|
||||
*/
|
||||
@ -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;
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* See: http://www.inspircd.org/wiki/index.php/Credits
|
||||
*
|
||||
* This program is free but copyrighted software; see
|
||||
* the file COPYING for details.
|
||||
* the file COPYING for details.
|
||||
*
|
||||
* ---------------------------------------------------
|
||||
*/
|
||||
@ -37,12 +37,21 @@ CmdResult CommandZline::Handle (const char** parameters, int pcnt, User *user)
|
||||
|
||||
long duration = ServerInstance->Duration(parameters[1]);
|
||||
|
||||
const char* ipaddr = parameters[0];
|
||||
if (strchr(ipaddr,'@'))
|
||||
const char* ipaddr = parameters[0];
|
||||
User* find = ServerInstance->FindNick(parameters[0]);
|
||||
|
||||
if (find)
|
||||
{
|
||||
while (*ipaddr != '@')
|
||||
ipaddr = find->GetIPString();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strchr(ipaddr,'@'))
|
||||
{
|
||||
while (*ipaddr != '@')
|
||||
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