summaryrefslogtreecommitdiff
path: root/modules/commands/cs_entrymsg.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-09-20 21:07:50 -0400
committerAdam <Adam@anope.org>2013-09-20 21:09:35 -0400
commite5ece18ee7804ed81f1b0f80af30a9aea8320522 (patch)
tree11ef551790936e22fb54122441fd152566ed0c17 /modules/commands/cs_entrymsg.cpp
parent8641b995c43593289dc4e66cbf980069b80d6d6b (diff)
Readonlyize many commands
Diffstat (limited to 'modules/commands/cs_entrymsg.cpp')
-rw-r--r--modules/commands/cs_entrymsg.cpp35
1 files changed, 20 insertions, 15 deletions
diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp
index fb21f35d7..fd9da0db8 100644
--- a/modules/commands/cs_entrymsg.cpp
+++ b/modules/commands/cs_entrymsg.cpp
@@ -203,25 +203,30 @@ class CommandEntryMessage : public Command
return;
}
- if (source.IsFounder(ci) || source.HasCommand("chanserv/set"))
+ if (Anope::ReadOnly && !params[1].equals_ci("LIST"))
{
- if (params[1].equals_ci("LIST"))
- this->DoList(source, ci);
- else if (params[1].equals_ci("CLEAR"))
- this->DoClear(source, ci);
- else if (params.size() < 3)
- this->OnSyntaxError(source, "");
- else if (params[1].equals_ci("ADD"))
- this->DoAdd(source, ci, params[2]);
- else if (params[1].equals_ci("DEL"))
- this->DoDel(source, ci, params[2]);
- else
- this->OnSyntaxError(source, "");
+ source.Reply(READ_ONLY_MODE);
+ return;
}
- else
+
+ if (!source.IsFounder(ci) && !source.HasCommand("chanserv/set"))
+ {
source.Reply(ACCESS_DENIED);
+ return;
+ }
- return;
+ if (params[1].equals_ci("LIST"))
+ this->DoList(source, ci);
+ else if (params[1].equals_ci("CLEAR"))
+ this->DoClear(source, ci);
+ else if (params.size() < 3)
+ this->OnSyntaxError(source, "");
+ else if (params[1].equals_ci("ADD"))
+ this->DoAdd(source, ci, params[2]);
+ else if (params[1].equals_ci("DEL"))
+ this->DoDel(source, ci, params[2]);
+ else
+ this->OnSyntaxError(source, "");
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override