diff options
author | Adam <Adam@anope.org> | 2011-08-21 14:33:11 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-08-21 14:33:11 -0400 |
commit | 68a125bf6e187c518372b8ee33815860f432db57 (patch) | |
tree | c160fa67795c1f9ad160d3d71cc9d008c7055405 /modules/commands/cs_set_misc.cpp | |
parent | 37c7ca8b87a3a94c7d541f88eec8e234b8d8ec4a (diff) |
Fixed ns_set_misc and cs_set_misc to allow unsetting values
Diffstat (limited to 'modules/commands/cs_set_misc.cpp')
-rw-r--r-- | modules/commands/cs_set_misc.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
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<Anope::string> ¶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) |