summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/example_new.conf10
-rw-r--r--include/extern.h10
-rw-r--r--src/config.c25
3 files changed, 25 insertions, 20 deletions
diff --git a/data/example_new.conf b/data/example_new.conf
index 44f08f00d..bb4baa938 100644
--- a/data/example_new.conf
+++ b/data/example_new.conf
@@ -714,4 +714,14 @@ operserv
* This directive is optional.
*/
logmaxusers = yes
+
+ /*
+ * These define the default expiration times for, respectively, AKILLs, CHANKILLs, SGLINEs,
+ * SQLINEs, and SZLINEs.
+ */
+ autokillexpiry = 30d
+ chankillexpiry = 30d
+ sglineexpiry = 30d
+ sqlineexpiry = 30d
+ szlineexpiry = 30d
}
diff --git a/include/extern.h b/include/extern.h
index abf1390d7..ba113d6c5 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -378,11 +378,11 @@ E int RootNumber;
E bool LogMaxUsers;
E bool SuperAdmin;
E int LogBot;
-E int AutokillExpiry;
-E int ChankillExpiry;
-E int SGLineExpiry;
-E int SQLineExpiry;
-E int SZLineExpiry;
+E time_t AutokillExpiry;
+E time_t ChankillExpiry;
+E time_t SGLineExpiry;
+E time_t SQLineExpiry;
+E time_t SZLineExpiry;
E int AkillOnAdd;
E int KillonSGline;
E int KillonSQline;
diff --git a/src/config.c b/src/config.c
index 2af02f061..44f17dd50 100644
--- a/src/config.c
+++ b/src/config.c
@@ -184,11 +184,11 @@ bool SuperAdmin;
int LogBot;
bool LogMaxUsers;
int DisableRaw;
-int AutokillExpiry;
-int ChankillExpiry;
-int SGLineExpiry;
-int SQLineExpiry;
-int SZLineExpiry;
+time_t AutokillExpiry;
+time_t ChankillExpiry;
+time_t SGLineExpiry;
+time_t SQLineExpiry;
+time_t SZLineExpiry;
int AkillOnAdd;
int KillonSGline;
int KillonSQline;
@@ -647,6 +647,11 @@ int ServerConfig::Read(bool bail)
{"operserv", "servicesroot", "", new ValueContainerChar(&ServicesRoot), DT_CHARPTR, ValidateNotEmpty},
{"operserv", "superadmin", "no", new ValueContainerBool(&SuperAdmin), DT_BOOLEAN, NoValidation},
{"operserv", "logmaxusers", "no", new ValueContainerBool(&LogMaxUsers), DT_BOOLEAN, NoValidation},
+ {"operserv", "autokillexpiry", "0", new ValueContainerTime(&AutokillExpiry), DT_TIME, ValidateNotZero},
+ {"operserv", "chankillexpiry", "0", new ValueContainerTime(&ChankillExpiry), DT_TIME, ValidateNotZero},
+ {"operserv", "sglineexpiry", "0", new ValueContainerTime(&SGLineExpiry), DT_TIME, ValidateNotZero},
+ {"operserv", "sqlineexpiry", "0", new ValueContainerTime(&SQLineExpiry), DT_TIME, ValidateNotZero},
+ {"operserv", "szlineexpiry", "0", new ValueContainerTime(&SZLineExpiry), DT_TIME, ValidateNotZero},
{NULL, NULL, NULL, NULL, DT_NOTHING, NoValidation}
};
/* These tags can occur multiple times, and therefore they have special code to read them
@@ -1221,8 +1226,6 @@ bool ValueItem::GetBool()
Directive directives[] = {
{"AkillOnAdd", {{PARAM_SET, PARAM_RELOAD, &AkillOnAdd}}},
- {"AutokillExpiry", {{PARAM_TIME, PARAM_RELOAD, &AutokillExpiry}}},
- {"ChankillExpiry", {{PARAM_TIME, PARAM_RELOAD, &ChankillExpiry}}},
{"BadPassLimit", {{PARAM_POSINT, PARAM_RELOAD, &BadPassLimit}}},
{"BadPassTimeout", {{PARAM_TIME, PARAM_RELOAD, &BadPassTimeout}}},
{"BotCoreModules", {{PARAM_STRING, PARAM_RELOAD, &BotCoreModules}}},
@@ -1312,9 +1315,6 @@ Directive directives[] = {
{{PARAM_STRING, PARAM_RELOAD, &SessionLimitExceeded}}},
{"SessionAutoKillExpiry",
{{PARAM_TIME, PARAM_RELOAD, &SessionAutoKillExpiry}}},
- {"SGLineExpiry", {{PARAM_TIME, PARAM_RELOAD, &SGLineExpiry}}},
- {"SQLineExpiry", {{PARAM_TIME, PARAM_RELOAD, &SQLineExpiry}}},
- {"SZLineExpiry", {{PARAM_TIME, PARAM_RELOAD, &SZLineExpiry}}},
{"HideStatsO", {{PARAM_SET, PARAM_RELOAD, &HideStatsO}}},
{"GlobalOnCycle", {{PARAM_SET, PARAM_RELOAD, &GlobalOnCycle}}},
{"AnonymousGlobal", {{PARAM_SET, PARAM_RELOAD, &AnonymousGlobal}}},
@@ -1696,11 +1696,6 @@ int read_config(int reload)
CHECK(ReadTimeout);
CHECK(WarningTimeout);
CHECK(TimeoutCheck);
- CHECK(AutokillExpiry);
- CHECK(ChankillExpiry);
- CHECK(SGLineExpiry);
- CHECK(SQLineExpiry);
- CHECK(SZLineExpiry);
if (!reload) {