]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
Tweaks to closed socket detection
[user/henk/code/inspircd.git] / src / command_parse.cpp
index e735ad828dc83f8ba3253364db39997c4a304fd6..18915b8194d9edd5ac0fdc4c9e0ad477277b25a2 100644 (file)
@@ -304,6 +304,11 @@ void CommandParser::CallHandler(std::string &commandname,char **parameters, int
                                        {
                                                n->second->Handle(parameters,pcnt,user);
                                        }
+                                       else
+                                       {
+                                               if (!IS_LOCAL(user))
+                                                       WriteOpers("*** \2WARNING\2: Command '%s' not allowed for oper '%s', dropped.",commandname.c_str(),user->nick);
+                                       }
                                }
                                else
                                {
@@ -582,6 +587,8 @@ void CommandParser::ProcessCommand(userrec *user, char* cmd)
                        {
                                log(DEBUG,"permission denied: %s %s",user->nick,command);
                                WriteServ(user->fd,"481 %s :Permission Denied- Oper type %s does not have access to command %s",user->nick,user->oper,command);
+                               if (!IS_LOCAL(user))
+                                       WriteOpers("*** \2WARNING\2: Command '%s' not allowed for oper '%s', dropped.",command,user->nick);
                                cmd_found = 1;
                                return;
                        }
@@ -742,13 +749,13 @@ void CommandParser::ProcessBuffer(const char* cmdbuf,userrec *user)
 bool CommandParser::CreateCommand(command_t *f)
 {
        /* create the command and push it onto the table */
-       if (cmdlist.find(f->command) != cmdlist.end())
+       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
+       else return false;
 }
 
 CommandParser::CommandParser()