summaryrefslogtreecommitdiff
path: root/modules/commands/cs_access.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-11-16 10:22:18 -0500
committerAdam <Adam@anope.org>2013-11-16 10:22:18 -0500
commit9e1fb11f93a7137c964170b196efde7bcb02ed1e (patch)
treec72d13375357aaaf62cdb5685b088b8d995e76cc /modules/commands/cs_access.cpp
parent316c280a571f83a468357ff0d6dabe2bab54f8b1 (diff)
Tell people why they cant disable the founder level instead of claiming it doesn't exist
Diffstat (limited to 'modules/commands/cs_access.cpp')
-rw-r--r--modules/commands/cs_access.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp
index 91ca8f1d9..63304b603 100644
--- a/modules/commands/cs_access.cpp
+++ b/modules/commands/cs_access.cpp
@@ -663,23 +663,24 @@ class CommandCSLevels : public Command
/* Don't allow disabling of the founder level. It would be hard to change it back if you dont have access to use this command */
if (!what.equals_ci("FOUNDER"))
{
- Privilege *p = PrivilegeManager::FindPrivilege(what);
- if (p != NULL)
- {
- ci->SetLevel(p->name, ACCESS_INVALID);
- FOREACH_MOD(OnLevelChange, (source, ci, p->name, ACCESS_INVALID));
+ source.Reply(_("You can not disable the founder privilege because it would be impossible to reenable it at a later time."));
+ return;
+ }
- bool override = !source.AccessFor(ci).HasPriv("FOUNDER");
- Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable " << p->name;
+ Privilege *p = PrivilegeManager::FindPrivilege(what);
+ if (p != NULL)
+ {
+ ci->SetLevel(p->name, ACCESS_INVALID);
+ FOREACH_MOD(OnLevelChange, (source, ci, p->name, ACCESS_INVALID));
- source.Reply(_("\002%s\002 disabled on channel %s."), p->name.c_str(), ci->name.c_str());
- return;
- }
+ bool override = !source.AccessFor(ci).HasPriv("FOUNDER");
+ Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable " << p->name;
+
+ source.Reply(_("\002%s\002 disabled on channel %s."), p->name.c_str(), ci->name.c_str());
+ return;
}
source.Reply(_("Setting \002%s\002 not known. Type \002%s%s HELP LEVELS\002 for a list of valid settings."), what.c_str(), Config->StrictPrivmsg.c_str(), source.service->nick.c_str());
-
- return;
}
void DoList(CommandSource &source, ChannelInfo *ci)