diff options
author | Adam <Adam@anope.org> | 2013-09-16 15:54:09 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-09-16 15:54:09 -0400 |
commit | 98bae827e1ab608c39f84c671f611f555797b29c (patch) | |
tree | c0c121651c4e831bd6d43bb1c5e62f3c0478d443 | |
parent | e3c05efe5e5085f3db14f1532a92de460b899ab5 (diff) |
Require confirmation in /cs drop by requesting the channel name twice
-rw-r--r-- | modules/commands/cs_drop.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/commands/cs_drop.cpp b/modules/commands/cs_drop.cpp index adbe1f2ca..e0b40a9d5 100644 --- a/modules/commands/cs_drop.cpp +++ b/modules/commands/cs_drop.cpp @@ -14,10 +14,10 @@ class CommandCSDrop : public Command { public: - CommandCSDrop(Module *creator) : Command(creator, "chanserv/drop", 1, 1) + CommandCSDrop(Module *creator) : Command(creator, "chanserv/drop", 1, 2) { this->SetDesc(_("Cancel the registration of a channel")); - this->SetSyntax(_("\037channel\037")); + this->SetSyntax(_("\037channel\037 \037channel\037")); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override @@ -37,6 +37,12 @@ class CommandCSDrop : public Command return; } + if (params.size() < 2 || !chan.equals_ci(params[1])) + { + source.Reply(_("You must enter the channel name twice as a confirmation that you wish to drop \2%s\2."), chan.c_str()); + return; + } + if ((ci->HasExt("SECUREFOUNDER") ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")) && !source.HasCommand("chanserv/drop")) { source.Reply(ACCESS_DENIED); |