summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-11-01 16:15:44 -0400
committerAdam <Adam@anope.org>2012-11-01 16:15:44 -0400
commita0a54fdfe058026f028dc0930e3ba982bce5b6dc (patch)
tree255ad4ecee2a6407c1113fc98ccd76bbfec0bfaa
parentd90d5d538bdbf6db2c1ca39e998e80c28a7b3c75 (diff)
Expand options:hideprivilegedcommands to not show commands requiring authentication to unidentified users
-rw-r--r--data/example.conf2
-rw-r--r--modules/commands/help.cpp22
-rw-r--r--modules/pseudoclients/nickserv.cpp3
-rw-r--r--src/config.cpp2
4 files changed, 19 insertions, 10 deletions
diff --git a/data/example.conf b/data/example.conf
index 9f3eebeb4..7bf1ea6ec 100644
--- a/data/example.conf
+++ b/data/example.conf
@@ -520,7 +520,7 @@ options
* If set, Services will hide commands that users don't have the privileges to execute
* from HELP output.
*/
- hideprivilegedcommands = no
+ hideprivilegedcommands = yes
/*
* If set, Services do not allow ownership of nick names, only ownership of accounts.
diff --git a/modules/commands/help.cpp b/modules/commands/help.cpp
index 28bf963a8..de80a6ec1 100644
--- a/modules/commands/help.cpp
+++ b/modules/commands/help.cpp
@@ -48,11 +48,16 @@ class CommandHelp : public Command
service_reference<Command> c("Command", info.name);
if (!c)
continue;
- if (!Config->HidePrivilegedCommands || info.permission.empty() || source.HasCommand(info.permission))
- {
- source.command = c_name;
- c->OnServHelp(source);
- }
+ else if (!Config->HidePrivilegedCommands)
+ ; // Always show with HidePrivilegedCommands disabled
+ else if (!c->HasFlag(CFLAG_ALLOW_UNREGISTERED) && !source.GetAccount())
+ continue;
+ else if (!info.permission.empty() && !source.HasCommand(info.permission))
+ continue;
+
+ source.command = c_name;
+ c->OnServHelp(source);
+
}
}
else
@@ -74,9 +79,12 @@ class CommandHelp : public Command
service_reference<Command> c("Command", info.name);
if (!c)
continue;
-
- if (Config->HidePrivilegedCommands && !info.permission.empty() && !source.HasCommand(info.permission))
+ else if (!Config->HidePrivilegedCommands)
+ ; // Always show with HidePrivilegedCommands disabled
+ else if (!info.permission.empty() && !source.HasCommand(info.permission))
continue;
+
+ // Allow unregistered users to see help for commands that they explicitly request help for
const Anope::string &subcommand = params.size() > max ? params[max] : "";
source.command = full_command;
diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp
index 34e8a5524..637003682 100644
--- a/modules/pseudoclients/nickserv.cpp
+++ b/modules/pseudoclients/nickserv.cpp
@@ -344,7 +344,8 @@ class NickServCore : public Module
"to identify for the nick, and may view the access list for\n"
"any nickname."));
if (Config->NSExpire >= 86400)
- source.Reply(_("Nicknames that are not used anymore are subject to \n"
+ source.Reply(_(" \n"
+ "Nicknames that are not used anymore are subject to \n"
"the automatic expiration, i.e. they will be deleted\n"
"after %d days if not used."), Config->NSExpire / 86400);
source.Reply(_(" \n"
diff --git a/src/config.cpp b/src/config.cpp
index 002e2917d..3f35a2ef2 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -1251,7 +1251,7 @@ ConfigItems::ConfigItems(ServerConfig *conf)
{"options", "ulineservers", "", new ValueContainerString(&UlineServers), DT_STRING, NoValidation},
{"options", "botmodes", "", new ValueContainerString(&conf->BotModes), DT_STRING, NoValidation},
{"options", "retrywait", "60", new ValueContainerInt(&conf->RetryWait), DT_INTEGER, ValidateNotZero},
- {"options", "hideprivilegedcommands", "no", new ValueContainerBool(&conf->HidePrivilegedCommands), DT_BOOLEAN, NoValidation},
+ {"options", "hideprivilegedcommands", "yes", new ValueContainerBool(&conf->HidePrivilegedCommands), DT_BOOLEAN, NoValidation},
{"options", "nonicknameownership", "no", new ValueContainerBool(&conf->NoNicknameOwnership), DT_BOOLEAN | DT_NORELOAD, NoValidation},
{"options", "regexengine", "", new ValueContainerString(&conf->RegexEngine), DT_STRING, NoValidation},
{"nickserv", "name", "", new ValueContainerString(&conf->NickServ), DT_STRING, NoValidation},