]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Move <security:userstats> into core_stats.
authorPeter Powell <petpow@saberuk.com>
Mon, 1 Oct 2018 15:53:27 +0000 (16:53 +0100)
committerPeter Powell <petpow@saberuk.com>
Mon, 1 Oct 2018 16:26:22 +0000 (17:26 +0100)
include/configreader.h
src/configreader.cpp
src/coremods/core_stats.cpp

index 2a1f072832ebfb7b322b436244ffe3f2e42c44ea..c63ea717afcfb605d49cd634c4bf7b96313c606e 100644 (file)
@@ -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;
index 661e81a6a520b5e5033d0b44b5d9c33e06bf48d7..f9eebe67267ff6f6480b266e12242d627c1a9f3d 100644 (file)
@@ -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"));
index 06602b28864f918e4398a8b35c29d49ff3561a42..6a4427aef8caeef674b34a1acf6e20004693e684 100644 (file)
@@ -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);