]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
Decide that it wasn't quite appropriate :(
[user/henk/code/inspircd.git] / src / command_parse.cpp
index e5fc8fd7d9b34575b699f6d6cb92ed0de468bf37..a606e572ce48370e5abd7b204bf7a165e4514e42 100644 (file)
@@ -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()