summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-08 17:26:33 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-08 17:26:33 +0000
commitfd81c672603dec9b47e720ebbfd98c6fc35be343 (patch)
treef8e6b2eda091ae1f4f988461c2be734a77233fe9 /src/inspircd.cpp
parentaf3020ad8a49b25663d713863aef209a4d514291 (diff)
Added ability to disable any command for non-opers
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1014 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp22
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);