X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommand_parse.cpp;h=a606e572ce48370e5abd7b204bf7a165e4514e42;hb=59b1a8955142935b02af6446005ab47fc7c3fc8c;hp=e5fc8fd7d9b34575b699f6d6cb92ed0de468bf37;hpb=9b4ff0ba5d363b6e1557666861932fa0ab527e7f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/command_parse.cpp b/src/command_parse.cpp index e5fc8fd7d..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) && (!strchr(user->modes,'o'))) + 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()