]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_globalload.cpp
m_callerid Route ACCEPT to the server of the target user only, do not send METADATA...
[user/henk/code/inspircd.git] / src / modules / m_globalload.cpp
index 5ece450810de48abe69a0b2160085bd522326ff8..7ceb2811504d01ffbf2d08d578407f3440ea5a83 100644 (file)
@@ -79,6 +79,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,22 +187,17 @@ class ModuleGlobalLoad : public Module
        {
        }
 
-       void init()
+       void init() CXX11_OVERRIDE
        {
-               ServerInstance->AddCommand(&cmd1);
-               ServerInstance->AddCommand(&cmd2);
-               ServerInstance->AddCommand(&cmd3);
+               ServerInstance->Modules->AddService(cmd1);
+               ServerInstance->Modules->AddService(cmd2);
+               ServerInstance->Modules->AddService(cmd3);
        }
 
-       ~ModuleGlobalLoad()
-       {
-       }
-
-       Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Allows global loading of a module.", VF_COMMON | VF_VENDOR);
        }
 };
 
 MODULE_INIT(ModuleGlobalLoad)
-