diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-28 00:17:40 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-28 00:17:40 +0000 |
commit | 40581b585d1cfd38c30547c147a4130524a33d3b (patch) | |
tree | 4dbdd0887cd906734473696ccddeefb0a16a379d /src/command_parse.cpp | |
parent | dc8f5d02f77aeabefaefe88005b99c8b47030ab7 (diff) |
Re-order stuff so that users cant get syntax for commands they dont have access to
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4562 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r-- | src/command_parse.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 1a32456b2..c7e368005 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -229,29 +229,16 @@ void CommandParser::ProcessCommand(userrec *user, std::string &cmd) { /* activity resets the ping pending timer */ user->nping = TIME + user->pingmax; - if (items < cm->second->min_params) - { - log(DEBUG,"not enough parameters: %s %s",user->nick,command.c_str()); - - /* If syntax is given, display this as the 461 reply */ - if (cm->second->syntax.length()) - WriteServ(user->fd,"461 %s %s :Syntax: %s %s", cm->second->command.c_str(), cm->second->syntax.c_str()); - else - WriteServ(user->fd,"461 %s %s :Not enough parameters",user->nick,command.c_str()); - return; - } if (cm->second->flags_needed) { if (!user->IsModeSet(cm->second->flags_needed)) { - log(DEBUG,"permission denied: %s %s",user->nick,command.c_str()); 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))) { - log(DEBUG,"permission denied: %s %s",user->nick,command.c_str()); 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; } @@ -261,6 +248,15 @@ void CommandParser::ProcessCommand(userrec *user, std::string &cmd) WriteServ(user->fd,"421 %s %s :This command has been disabled.",user->nick,command.c_str()); return; } + if (items < cm->second->min_params) + { + /* If syntax is given, display this as the 461 reply */ + if (cm->second->syntax.length()) + WriteServ(user->fd,"461 %s %s :Syntax: %s %s", user->nick, command.c_str(), cm->second->command.c_str(), cm->second->syntax.c_str()); + else + WriteServ(user->fd,"461 %s %s :Not enough parameters", user->nick, command.c_str()); + return; + } if ((user->registered == 7) || (cm->second == command_user) || (cm->second == command_nick) || (cm->second == command_pass)) { /* ikky /stats counters */ |