X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_zline.cpp;h=a9f76a9328b286c1d6dcede0cf26411fae5d809e;hb=5db1d322be106c8462dc691072f9415dc0766ed4;hp=520bea30653de9b1c637b919cee27139062a9412;hpb=5ecd5447d0f52592b121778f251965179597466d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_zline.cpp b/src/commands/cmd_zline.cpp index 520bea306..a9f76a932 100644 --- a/src/commands/cmd_zline.cpp +++ b/src/commands/cmd_zline.cpp @@ -2,11 +2,11 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * InspIRCd: (C) 2002-2008 InspIRCd Development Team * 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. * * --------------------------------------------------- */ @@ -32,17 +32,33 @@ CmdResult CommandZline::Handle (const char** parameters, int pcnt, User *user) return CMD_FAILURE; } + User *u = ServerInstance->FindNick(parameters[0]); + + if (u) + { + parameters[0] = u->GetIPString(); + } + if (ServerInstance->IPMatchesEveryone(parameters[0],user)) return CMD_FAILURE; 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))