Add <disabled:fakenonexistant> - ircd will pretend that a disabled command just doesn't exist (for austnet), document <disabled:usermodes> and <disabled:chanmodes> (bad aquanight.)

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10327 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
w00t 2008-08-27 20:19:26 +00:00
parent a215177f31
commit dfba08638c
4 changed files with 25 additions and 7 deletions

View File

@ -757,17 +757,21 @@
<banlist chan="#morons" limit="128">
<banlist chan="*" limit="69">
#-#-#-#-#-#-#-#-#-#-#- DISABLED COMMANDS -#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#-#-#-#-#-#-#-#- DISABLED FEATURES -#-#-#-#-#-#-#-#-#-#-#-#-#-#
# #
# This tag is optional, and specifies one or more commands which are #
# not available to non-operators. For example you may wish to disable #
# NICK and prevent non-opers from changing their nicknames. #
# This tag is optional, and specifies one or more features which are #
# not available to non-operators. #
# #
# For example you may wish to disable NICK and prevent non-opers from #
# changing their nicknames. #
# Note that any disabled commands take effect only after the user has #
# 'registered' (e.g. after the initial USER/NICK/PASS on connection) #
# so for example disabling NICK will not cripple your network. #
# #
#<disabled commands="TOPIC MODE">
# `fakenonexistant' will make the ircd pretend that nonexistant #
# commands simply don't exist to non-opers ("no such command"). #
# #
#<disabled commands="TOPIC MODE" usermodes="" chanmodes="" fakenonexistant="yes">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- RTFM LINE -#-#-#-#-#-#-#-#-#-#-#-#-#-#

View File

@ -439,6 +439,10 @@ class CoreExport ServerConfig : public Extensible
*/
char DNSServer[MAXBUF];
/** Pretend disabled commands don't exist.
*/
bool DisabledDontExist;
/** This variable contains a space-seperated list
* of commands which are disabled by the
* administrator of the server for non-opers.

View File

@ -326,7 +326,16 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd)
if ((user->registered == REG_ALL) && (!IS_OPER(user)) && (cm->second->IsDisabled()))
{
/* command is disabled! */
user->WriteNumeric(ERR_UNKNOWNCOMMAND, "%s %s :This command has been disabled.",user->nick.c_str(),command.c_str());
if (ServerInstance->Config->DisabledDontExist)
{
user->WriteNumeric(ERR_UNKNOWNCOMMAND, "%s %s :Unknown command",user->nick.c_str(),command.c_str());
}
else
{
user->WriteNumeric(ERR_UNKNOWNCOMMAND, "%s %s :This command has been disabled.",
user->nick.c_str(), command.c_str());
}
ServerInstance->SNO->WriteToSnoMask('d', "%s denied for %s (%s@%s)",
command.c_str(), user->nick.c_str(), user->ident.c_str(), user->host.c_str());
return do_more;

View File

@ -843,6 +843,7 @@ void ServerConfig::Read(bool bail, User* user)
{"disabled", "commands", "", new ValueContainerChar (this->DisabledCommands), DT_CHARPTR, NoValidation},
{"disabled", "usermodes", "", new ValueContainerChar (disabledumodes), DT_CHARPTR, ValidateDisabledUModes},
{"disabled", "chanmodes", "", new ValueContainerChar (disabledcmodes), DT_CHARPTR, ValidateDisabledCModes},
{"disabled", "fakenonexistant", "0", new ValueContainerBool (&this->DisabledDontExist), DT_BOOLEAN, NoValidation},
{"security", "userstats", "", new ValueContainerChar (this->UserStats), DT_CHARPTR, NoValidation},
{"security", "customversion","", new ValueContainerChar (this->CustomVersion), DT_CHARPTR, NoValidation},
{"security", "hidesplits", "0", new ValueContainerBool (&this->HideSplits), DT_BOOLEAN, NoValidation},