From 98bae827e1ab608c39f84c671f611f555797b29c Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 16 Sep 2013 15:54:09 -0400 Subject: Require confirmation in /cs drop by requesting the channel name twice --- modules/commands/cs_drop.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'modules/commands/cs_drop.cpp') 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 ¶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); -- cgit