]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_xline/cmd_zline.cpp
Add a helper function for calling the OnCheckExemption event.
[user/henk/code/inspircd.git] / src / coremods / core_xline / cmd_zline.cpp
index 5eeebf1752bd2916785e9776ba517d6a6cede45b..af9d54a5b6e66b4a4df55daddf8312b4e34e3788 100644 (file)
@@ -27,7 +27,6 @@ CommandZline::CommandZline(Module* parent)
        : Command(parent, "ZLINE", 1, 3)
 {
        flags_needed = 'o';
-       Penalty = 0;
        syntax = "<ipmask> [<duration> :<reason>]";
 }
 
@@ -59,7 +58,8 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User
                        ipaddr++;
                }
 
-               if (ServerInstance->IPMatchesEveryone(ipaddr,user))
+               IPMatcher matcher;
+               if (InsaneBan::MatchesEveryone(ipaddr, matcher, user, "Z", "ipmasks"))
                        return CMD_FAILURE;
 
                unsigned long duration = InspIRCd::Duration(parameters[1]);
@@ -100,3 +100,8 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User
 
        return CMD_SUCCESS;
 }
+
+bool CommandZline::IPMatcher::Check(User* user, const std::string& ip) const
+{
+       return InspIRCd::MatchCIDR(user->GetIPString(), ip, ascii_case_insensitive_map);
+}