CmdResult Handle (const std::vector<std::string> ¶meters, 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))
void init()
{
- ServerInstance->AddCommand(&cmd1);
- ServerInstance->AddCommand(&cmd2);
- ServerInstance->AddCommand(&cmd3);
- }
-
- ~ModuleGlobalLoad()
- {
+ ServerInstance->Modules->AddService(cmd1);
+ ServerInstance->Modules->AddService(cmd2);
+ ServerInstance->Modules->AddService(cmd3);
}
Version GetVersion()
};
MODULE_INIT(ModuleGlobalLoad)
-