X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommand_parse.cpp;h=a606e572ce48370e5abd7b204bf7a165e4514e42;hb=59b1a8955142935b02af6446005ab47fc7c3fc8c;hp=0c61fd8b1ec24fe7b8392152e47a2f758eafa3b6;hpb=feaf72ecb48470114fbe3f3058b5f4b9622b88a5;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 0c61fd8b1..a606e572c 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -596,14 +596,12 @@ void CommandParser::ProcessCommand(userrec *user, char* cmd) return; } } - if ((user->registered == 7) && (!*user->oper)) + if ((user->registered == 7) && (!*user->oper) && (*Config->DisabledCommands)) { std::stringstream dcmds(Config->DisabledCommands); - while (!dcmds.eof()) + std::string thiscmd; + while (dcmds >> thiscmd) { - std::string thiscmd; - dcmds >> thiscmd; - if (!strcasecmp(thiscmd.c_str(),command)) { // command is disabled! @@ -744,9 +742,13 @@ void CommandParser::ProcessBuffer(const char* cmdbuf,userrec *user) bool CommandParser::CreateCommand(command_t *f) { /* create the command and push it onto the table */ - cmdlist[f->command] = f; - log(DEBUG,"Added command %s (%lu parameters)",f->command.c_str(),(unsigned long)f->min_params); - return true; + if (cmdlist.find(f->command) == cmdlist.end()) + { + cmdlist[f->command] = f; + log(DEBUG,"Added command %s (%lu parameters)",f->command.c_str(),(unsigned long)f->min_params); + return true; + } + else return false; } CommandParser::CommandParser()