From 68a125bf6e187c518372b8ee33815860f432db57 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 21 Aug 2011 14:33:11 -0400 Subject: Fixed ns_set_misc and cs_set_misc to allow unsetting values --- modules/commands/cs_set_misc.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'modules/commands/cs_set_misc.cpp') diff --git a/modules/commands/cs_set_misc.cpp b/modules/commands/cs_set_misc.cpp index fd73d8f90..37a8dda4e 100644 --- a/modules/commands/cs_set_misc.cpp +++ b/modules/commands/cs_set_misc.cpp @@ -15,9 +15,9 @@ class CommandCSSetMisc : public Command { public: - CommandCSSetMisc(Module *creator, const Anope::string &cname = "chanserv/set/misc") : Command(creator, cname, 1, 2) + CommandCSSetMisc(Module *creator, const Anope::string &cname = "chanserv/set/misc") : Command(creator, cname, 1, 1) { - this->SetSyntax(_("\037channel\037 \037parameters\037")); + this->SetSyntax(_("\037channel\037 [\037parameters\037]")); } void Execute(CommandSource &source, const std::vector ¶ms) @@ -28,6 +28,11 @@ class CommandCSSetMisc : public Command source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str()); return; } + else if (source.permission.empty() && !ci->AccessFor(source.u).HasPriv(CA_SET)) + { + source.Reply(ACCESS_DENIED); + return; + } ci->Shrink("cs_set_misc:" + source.command.replace_all_cs(" ", "_")); if (params.size() > 1) -- cgit