summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-13 22:53:38 +0000
committerNaram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-13 22:53:38 +0000
commitc4a8ddaa24fc6f5ff8b4a72ac797a93aff6f997e (patch)
tree8796a58d5eb090c1dca5f6485523cda6c37b4f0b
parent1ed824416627e36f135e5ace4fc745e5a6ae39ae (diff)
Added defbantype directive to chanserv block in new config.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1435 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--data/example_new.conf12
-rw-r--r--src/config.c9
2 files changed, 20 insertions, 1 deletions
diff --git a/data/example_new.conf b/data/example_new.conf
index 935e2aed5..5c3bbff2d 100644
--- a/data/example_new.conf
+++ b/data/example_new.conf
@@ -378,4 +378,16 @@ chanserv
* recommended. If not set, the default is 14 days.
*/
expire = 14d
+
+ /*
+ * The default ban type for newly registered channels (and when importing old databases).
+ *
+ * defbantype can be:
+ *
+ * 0: ban in the form of *!user@host
+ * 1: ban in the form of *!*user@host
+ * 2: ban in the form of *!*@host
+ * 3: ban in the form of *!*user@*.domain
+ */
+ defbantype = 2
}
diff --git a/src/config.c b/src/config.c
index d0fce64e1..beebbead5 100644
--- a/src/config.c
+++ b/src/config.c
@@ -476,6 +476,13 @@ bool ValidateGuestPrefix(ServerConfig *conf, const char *tag, const char *value,
return true;
}
+bool ValidateBantype(ServerConfig *, const char *, const char *, ValueItem &data)
+{
+ int bantype = data.GetInteger();
+ if (bantype < 0 || bantype > 3) throw ConfigException("The value for <chanserv:defbantype> must be between 0 and 3!");
+ return true;
+}
+
void ServerConfig::ReportConfigError(const std::string &errormessage, bool bail)
{
alog("There were errors in your configuration file: %s", errormessage.c_str());
@@ -578,6 +585,7 @@ int ServerConfig::Read(bool bail)
{"chanserv", "defaults", "keetopic secure securefounder signkick", new ValueContainerString(&CSDefaults), DT_BOOLEAN, NoValidation},
{"chanserv", "maxregistered", "0", new ValueContainerInt(&CSMaxReg), DT_INTEGER, NoValidation},
{"chanserv", "expire", "14d", new ValueContainerTime(&CSExpire), DT_TIME, NoValidation},
+ {"chanserv", "defbantype", "2", new ValueContainerInt(&CSDefBantype), DT_INTEGER, ValidateBantype},
{NULL, NULL, NULL, NULL, DT_NOTHING, NoValidation}
};
/* These tags can occur multiple times, and therefore they have special code to read them
@@ -1183,7 +1191,6 @@ Directive directives[] = {
{"CSAutokickMax", {{PARAM_POSINT, PARAM_RELOAD, &CSAutokickMax}}},
{"CSAutokickReason",
{{PARAM_STRING, PARAM_RELOAD, &CSAutokickReason}}},
- {"CSDefBantype", {{PARAM_INT, PARAM_RELOAD, &CSDefBantype}}},
{"CSInhabit", {{PARAM_TIME, PARAM_RELOAD, &CSInhabit}}},
{"CSListMax", {{PARAM_POSINT, PARAM_RELOAD, &CSListMax}}},
{"CSListOpersOnly", {{PARAM_SET, PARAM_RELOAD, &CSListOpersOnly}}},