diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-16 16:30:03 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-16 16:30:03 +0000 |
commit | a6884342b0200d5233502015b62e8b31a0105924 (patch) | |
tree | 890460cd0fe69bfa8aabe3db426a221723e989c3 /src/modules | |
parent | 2352b3a3ef955a1cba8646733c43c8eaf6936187 (diff) |
Idea from nenolod, dont allow you to add yourself to your own dccallow list (!)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5482 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_dccallow.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index 13d42c0b9..a3ddb2e41 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -57,7 +57,7 @@ class cmd_dccallow : public command_t { // display current DCCALLOW list DisplayDCCAllowList(user); - return CMD_SUCCESS; + return CMD_FAILURE; } else if (pcnt > 0) { @@ -70,13 +70,13 @@ class cmd_dccallow : public command_t { // list current DCCALLOW list DisplayDCCAllowList(user); - return CMD_SUCCESS; + return CMD_FAILURE; } else if (!strcasecmp(parameters[0], "HELP")) { // display help DisplayHelp(user); - return CMD_SUCCESS; + return CMD_FAILURE; } } @@ -141,12 +141,17 @@ class cmd_dccallow : public command_t if (k->nickname == target->nick) { user->WriteServ("996 %s %s :%s is already on your DCCALLOW list", user->nick, user->nick, target->nick); - return CMD_SUCCESS; + return CMD_FAILURE; + } + else if (ServerInstance->MatchText(user->GetFullHost(), k->hostmask)) + { + user->WriteServ("996 %s %s :You cannot add yourself to your own DCCALLOW list!", user->nick, user->nick); + return CMD_FAILURE; } } std::string mask = std::string(target->nick)+"!"+std::string(target->ident)+"@"+std::string(target->dhost); - std::string default_length = Conf->ReadValue("dccallow", "length", 0).c_str(); + std::string default_length = Conf->ReadValue("dccallow", "length", 0); long length; if (pcnt < 2) @@ -178,7 +183,7 @@ class cmd_dccallow : public command_t user->WriteServ("994 %s %s :Added %s to DCCALLOW list for this session", user->nick, user->nick, target->nick); } - return CMD_SUCCESS; + return CMD_FAILURE; } } else @@ -188,7 +193,7 @@ class cmd_dccallow : public command_t return CMD_FAILURE; } } - return CMD_SUCCESS; + return CMD_FAILURE; } void DisplayHelp(userrec* user) |