summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-10-01 16:53:27 +0100
committerPeter Powell <petpow@saberuk.com>2018-10-01 17:26:22 +0100
commit08177bccc25500994d96dfa8679cd7da30cdb800 (patch)
treea2b5a71e4ed19e16919f6bbdeed3aea002fac0b3
parentd7dd8d193c2e6176e97ec182d65b6ba1d0800aa5 (diff)
Move <security:userstats> into core_stats.
-rw-r--r--include/configreader.h5
-rw-r--r--src/configreader.cpp1
-rw-r--r--src/coremods/core_stats.cpp13
3 files changed, 10 insertions, 9 deletions
diff --git a/include/configreader.h b/include/configreader.h
index 2a1f07283..c63ea717a 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -396,11 +396,6 @@ class CoreExport ServerConfig
*/
ClassVector Classes;
- /** STATS characters in this list are available
- * only to operators.
- */
- std::string UserStats;
-
/** Default channel modes
*/
std::string DefaultModes;
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 661e81a6a..f9eebe672 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -407,7 +407,6 @@ void ServerConfig::Fill()
Network = server->getString("network", "Network");
NetBufferSize = ConfValue("performance")->getInt("netbuffersize", 10240, 1024, 65534);
DisabledDontExist = ConfValue("disabled")->getBool("fakenonexistant");
- UserStats = security->getString("userstats");
CustomVersion = security->getString("customversion");
HideBans = security->getBool("hidebans");
HideServer = security->getString("hideserver", security->getString("hidewhois"));
diff --git a/src/coremods/core_stats.cpp b/src/coremods/core_stats.cpp
index 06602b288..6a4427aef 100644
--- a/src/coremods/core_stats.cpp
+++ b/src/coremods/core_stats.cpp
@@ -36,8 +36,9 @@ class CommandStats : public Command
void DoStats(Stats::Context& stats);
public:
- /** Constructor for stats.
- */
+ /** STATS characters which non-opers can request. */
+ std::string userstats;
+
CommandStats(Module* Creator)
: Command(Creator, "STATS", 1, 2)
, statsevprov(Creator, "event/stats")
@@ -77,7 +78,7 @@ void CommandStats::DoStats(Stats::Context& stats)
User* const user = stats.GetSource();
const char statschar = stats.GetSymbol();
- bool isPublic = ServerInstance->Config->UserStats.find(statschar) != std::string::npos;
+ bool isPublic = userstats.find(statschar) != std::string::npos;
bool isRemoteOper = IS_REMOTE(user) && (user->IsOper());
bool isLocalOperWithPrivs = IS_LOCAL(user) && user->HasPrivPermission("servers/auspex");
@@ -408,6 +409,12 @@ class CoreModStats : public Module
{
}
+ void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
+ {
+ ConfigTag* security = ServerInstance->Config->ConfValue("security");
+ cmd.userstats = security->getString("userstats");
+ }
+
Version GetVersion() CXX11_OVERRIDE
{
return Version("Provides the STATS command", VF_CORE | VF_VENDOR);