mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 19:19:02 -04:00
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
This commit is contained in:
parent
af3020ad8a
commit
fd81c67260
@ -89,6 +89,8 @@ extern int MaxWhoResults;
|
|||||||
time_t nb_start = 0;
|
time_t nb_start = 0;
|
||||||
int dns_timeout = 5;
|
int dns_timeout = 5;
|
||||||
|
|
||||||
|
char DisbledCommands[MAXBUF];
|
||||||
|
|
||||||
bool AllowHalfop = true;
|
bool AllowHalfop = true;
|
||||||
bool AllowProtect = true;
|
bool AllowProtect = true;
|
||||||
bool AllowFounder = true;
|
bool AllowFounder = true;
|
||||||
@ -377,6 +379,8 @@ void ReadConfig(bool bail, userrec* user)
|
|||||||
ConfValue("dns","server",0,DNSServer,&config_f);
|
ConfValue("dns","server",0,DNSServer,&config_f);
|
||||||
ConfValue("dns","timeout",0,DNT,&config_f);
|
ConfValue("dns","timeout",0,DNT,&config_f);
|
||||||
ConfValue("options","moduledir",0,ModPath,&config_f);
|
ConfValue("options","moduledir",0,ModPath,&config_f);
|
||||||
|
ConfValue("disabled","commands",k,DisabledCommands,&config_f);
|
||||||
|
|
||||||
NetBufferSize = atoi(NB);
|
NetBufferSize = atoi(NB);
|
||||||
MaxWhoResults = atoi(MW);
|
MaxWhoResults = atoi(MW);
|
||||||
dns_timeout = atoi(DNT);
|
dns_timeout = atoi(DNT);
|
||||||
@ -2960,6 +2964,24 @@ void process_command(userrec *user, char* cmd)
|
|||||||
WriteServ(user->fd,"451 %s :You have not registered",command);
|
WriteServ(user->fd,"451 %s :You have not registered",command);
|
||||||
return;
|
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")))
|
if ((user->registered == 7) || (!strcmp(command,"USER")) || (!strcmp(command,"NICK")) || (!strcmp(command,"PASS")))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user