]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
Dont try and cloak remote clients
[user/henk/code/inspircd.git] / src / command_parse.cpp
index 10fe6e1eeadec5ea542eb2113ab6e82b758ec356..922427c289f575d2b101e8fedcd691021ff41947 100644 (file)
 #include <string>
 #include <sstream>
 #include <vector>
-#include <sched.h>
-#ifdef THREADED_DNS
-#include <pthread.h>
-#endif
+#include <algorithm>
 #include "users.h"
 #include "globals.h"
 #include "modules.h"
@@ -40,7 +37,6 @@
 #include "commands.h"
 #include "xline.h"
 #include "inspstring.h"
-#include "dnsqueue.h"
 #include "helperfuncs.h"
 #include "hashcomp.h"
 #include "socketengine.h"
@@ -212,8 +208,7 @@ void CommandParser::ProcessCommand(userrec *user, std::string &cmd)
        while (((para[items] = tokens.GetToken()) != "") && (items < 127))
                command_p[items] = para[items++].c_str();
 
-       for (std::string::iterator makeupper = command.begin(); makeupper != command.end(); makeupper++)
-               *makeupper = toupper(*makeupper);
+       std::transform(command.begin(), command.end(), command.begin(), ::toupper);
                
        int MOD_RESULT = 0;
        FOREACH_RESULT(I_OnPreCommand,OnPreCommand(command,command_p,items,user,false));
@@ -236,11 +231,11 @@ void CommandParser::ProcessCommand(userrec *user, std::string &cmd)
                                        WriteServ(user->fd,"481 %s :Permission Denied- You do not have the required operator privilages",user->nick);
                                        return;
                                }
-                       }
-                       if ((cm->second->flags_needed) && (!user->HasPermission(command)))
-                       {
-                               WriteServ(user->fd,"481 %s :Permission Denied- Oper type %s does not have access to command %s",user->nick,user->oper,command.c_str());
-                               return;
+                               if (!user->HasPermission(command))
+                               {
+                                       WriteServ(user->fd,"481 %s :Permission Denied- Oper type %s does not have access to command %s",user->nick,user->oper,command.c_str());
+                                       return;
+                               }
                        }
                        if ((user->registered == REG_ALL) && (!*user->oper) && (cm->second->IsDisabled()))
                        {