diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-08 17:44:16 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-08 17:44:16 +0000 |
commit | 33ed72a1dfae595132dd50c760b6a312ef2ce8fe (patch) | |
tree | 028c5a9cd64e99ee0574a0e9e89e8e2b5d2a0d1a /src/command_parse.cpp | |
parent | d40e1e5b0b8c4b94359637921387cd80e9de991b (diff) |
Refactored user modes to work like the channel modes - core and module data now the same storage format without ::modebits
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4175 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r-- | src/command_parse.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 7a26f209b..befcde7ca 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -306,7 +306,7 @@ bool CommandParser::IsValidCommand(const std::string &commandname, int pcnt, use { if ((pcnt>=n->second->min_params) && (n->second->source != "<core>")) { - if ((strchr(user->modes,n->second->flags_needed)) || (!n->second->flags_needed)) + if ((!n->second->flags_needed) || (user->modes[n->second->flags_needed-65])) { if (n->second->flags_needed) { @@ -329,7 +329,7 @@ bool CommandParser::CallHandler(const std::string &commandname,char **parameters { if (pcnt >= n->second->min_params) { - if ((strchr(user->modes,n->second->flags_needed)) || (!n->second->flags_needed)) + if ((!n->second->flags_needed) || (user->modes[n->second->flags_needed-65])) { if (n->second->flags_needed) { @@ -603,12 +603,15 @@ void CommandParser::ProcessCommand(userrec *user, char* cmd) WriteServ(user->fd,"461 %s %s :Not enough parameters",user->nick,command); return; } - if ((!strchr(user->modes,cm->second->flags_needed)) && (cm->second->flags_needed)) + if (cm->second->flags_needed) { - log(DEBUG,"permission denied: %s %s",user->nick,command); - WriteServ(user->fd,"481 %s :Permission Denied- You do not have the required operator privilages",user->nick); - cmd_found = 1; - return; + if (!user->modes[cm->second->flags_needed-65]) + { + log(DEBUG,"permission denied: %s %s",user->nick,command); + WriteServ(user->fd,"481 %s :Permission Denied- You do not have the required operator privilages",user->nick); + cmd_found = 1; + return; + } } if ((cm->second->flags_needed) && (!user->HasPermission(xcommand))) { |