diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/inspircd.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index dd8f9e824..8d445ce06 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -89,6 +89,8 @@ extern int MaxWhoResults; time_t nb_start = 0; int dns_timeout = 5; +char DisbledCommands[MAXBUF]; + bool AllowHalfop = true; bool AllowProtect = true; bool AllowFounder = true; @@ -377,6 +379,8 @@ void ReadConfig(bool bail, userrec* user) ConfValue("dns","server",0,DNSServer,&config_f); ConfValue("dns","timeout",0,DNT,&config_f); ConfValue("options","moduledir",0,ModPath,&config_f); + ConfValue("disabled","commands",k,DisabledCommands,&config_f); + NetBufferSize = atoi(NB); MaxWhoResults = atoi(MW); dns_timeout = atoi(DNT); @@ -2961,6 +2965,24 @@ void process_command(userrec *user, char* cmd) return; } } + if ((user->registered == 7) && (!strchr(user->modes,'o'))) + { + char* mycmd; + char* savept2; + mycmd = strtok_r(DisabledCommands," ",&savept2); + while (mycmd) + { + if (!strcasecmp(mycmd,SomeCommand)) + { + // command is disabled! + WriteServ(user->fd,"421 %s %s :This command has been disabled.",user->nick,command); + return; + } + mycmd = strtok_r(NULL," ",&savept2); + } + + + } if ((user->registered == 7) || (!strcmp(command,"USER")) || (!strcmp(command,"NICK")) || (!strcmp(command,"PASS"))) { log(DEBUG,"process_command: handler: %s %s %d",user->nick,command,items); |