X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fconfigreader.cpp;h=b5ea8a8155079c25464ad87f5a10cf582761c075;hb=c4458ecc70025aeac7ca87115ed0a698e7bbcdad;hp=2cc1cd9c18af0f72220ae7004d62412d5f91e8a6;hpb=75eb9178d5051046aa86d1115ad02c5be17b79be;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/configreader.cpp b/src/configreader.cpp index 2cc1cd9c1..b5ea8a815 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -45,7 +45,7 @@ ServerConfig::ServerConfig() *CustomVersion = *motd = *rules = *PrefixQuit = *DieValue = *DNSServer = '\0'; *OperOnlyStats = *ModPath = *MyExecutable = *DisabledCommands = *PID = '\0'; log_file = NULL; - forcedebug = OperSpyWhois = nofork = HideBans = HideSplits = false; + NoUserDns = forcedebug = OperSpyWhois = nofork = HideBans = HideSplits = false; writelog = AllowHalfop = true; dns_timeout = DieDelay = 5; MaxTargets = 20; @@ -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; @@ -545,6 +567,7 @@ void ServerConfig::Read(bool bail, userrec* user) {"options", "hidewhois", &this->HideWhoisServer, DT_CHARPTR, NoValidation}, {"options", "operspywhois", &this->OperSpyWhois, DT_BOOLEAN, NoValidation}, {"options", "tempdir", &this->TempDir, DT_CHARPTR, ValidateTempDir}, + {"options", "nouserdns", &this->NoUserDns, DT_BOOLEAN, NoValidation}, {"pid", "file", &this->PID, DT_CHARPTR, NoValidation}, {NULL} };