]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_globalload.cpp
m_spanningtree Remove SpanningTreeUtilities* fields and parameters
[user/henk/code/inspircd.git] / src / modules / m_globalload.cpp
index d623ed262344488ab604fc79a671a114b63a832e..2c936d5ea3dbff4cc53fbc51cee10c83ee88e54c 100644 (file)
@@ -22,8 +22,6 @@
  */
 
 
-/* $ModDesc: Allows global loading of a module. */
-
 #include "inspircd.h"
 
 /** Handle /GLOADMODULE
@@ -35,7 +33,6 @@ class CommandGloadmodule : public Command
        {
                flags_needed = 'o';
                syntax = "<modulename> [servermask]";
-               TRANSLATE3(TR_TEXT, TR_TEXT, TR_END);
        }
 
        CmdResult Handle (const std::vector<std::string> &parameters, User *user)
@@ -79,6 +76,13 @@ class CommandGunloadmodule : public Command
 
        CmdResult Handle (const std::vector<std::string> &parameters, User *user)
        {
+               if (!ServerInstance->Config->ConfValue("security")->getBool("allowcoreunload") &&
+                       InspIRCd::Match(parameters[0], "cmd_*.so", ascii_case_insensitive_map))
+               {
+                       user->WriteNumeric(972, "%s %s :You cannot unload core commands!", user->nick.c_str(), parameters[0].c_str());
+                       return CMD_FAILURE;
+               }
+
                std::string servername = parameters.size() > 1 ? parameters[1] : "*";
 
                if (InspIRCd::Match(ServerInstance->Config->ServerName.c_str(), servername))
@@ -180,14 +184,14 @@ class ModuleGlobalLoad : public Module
        {
        }
 
-       void init()
+       void init() CXX11_OVERRIDE
        {
                ServerInstance->Modules->AddService(cmd1);
                ServerInstance->Modules->AddService(cmd2);
                ServerInstance->Modules->AddService(cmd3);
        }
 
-       Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Allows global loading of a module.", VF_COMMON | VF_VENDOR);
        }