X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fconfigreader.cpp;h=b5ea8a8155079c25464ad87f5a10cf582761c075;hb=c4458ecc70025aeac7ca87115ed0a698e7bbcdad;hp=04918e7cf001cd004b8e85aa160e465ef335beb7;hpb=d4ca01f12f539a7f3eda3a682b5d2fbb67fabdb7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/configreader.cpp b/src/configreader.cpp index 04918e7cf..b5ea8a815 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -200,6 +200,28 @@ bool ValidateDnsTimeout(const char* tag, const char* value, void* data) return true; } +bool InitializeDisabledCommands(const char* data, InspIRCd* ServerInstance) +{ + std::stringstream dcmds(data); + std::string thiscmd; + + /* Enable everything first */ + for (nspace::hash_map::iterator x = ServerInstance->Parser->cmdlist.begin(); x != ServerInstance->Parser->cmdlist.end(); x++) + x->second->Disable(false); + + /* Now disable all the ones which the user wants disabled */ + while (dcmds >> thiscmd) + { + nspace::hash_map::iterator cm = ServerInstance->Parser->cmdlist.find(thiscmd); + if (cm != ServerInstance->Parser->cmdlist.end()) + { + log(DEBUG,"Disabling command '%s'",cm->second->command.c_str()); + cm->second->Disable(true); + } + } + return true; +} + bool ValidateDnsServer(const char* tag, const char* value, void* data) { char* x = (char*)data;