diff options
author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-15 19:13:26 +0000 |
---|---|---|
committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-15 19:13:26 +0000 |
commit | ec8fd88965d710cd7c75729e1e95931596997bc7 (patch) | |
tree | ad54883c37e26b018ccfe5c151b8351e14701281 | |
parent | 675c8dc34ac7002df34e154264574c741b61d64d (diff) |
Added badpasstimeout directive to options block in new config.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1710 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | data/example_new.conf | 9 | ||||
-rw-r--r-- | include/extern.h | 2 | ||||
-rw-r--r-- | src/config.c | 4 |
3 files changed, 12 insertions, 3 deletions
diff --git a/data/example_new.conf b/data/example_new.conf index 129dea7da..1a2275e37 100644 --- a/data/example_new.conf +++ b/data/example_new.conf @@ -286,6 +286,15 @@ options { * directive is optional, but recommended. */ badpasslimit = 5 + + /* + * Sets the time after which invalid passwords are forgotten about. If a user + * does not enter any incorrect passwords in this amount of time, the incorrect + * password count will reset to zero. If not given, the timeout will be + * disabled, and the incorrect password count will never be reset until the user + * disconnects. This directive is optional. + */ + badpasstimeout = 1h } /* diff --git a/include/extern.h b/include/extern.h index 6e3495ece..f794be649 100644 --- a/include/extern.h +++ b/include/extern.h @@ -286,7 +286,7 @@ E char *NewsDBName; E bool NoBackupOkay; E bool StrictPasswords; E int BadPassLimit; -E int BadPassTimeout; +E time_t BadPassTimeout; E int UpdateTimeout; E int ExpireTimeout; E int ReadTimeout; diff --git a/src/config.c b/src/config.c index b57ddc683..7f1641e95 100644 --- a/src/config.c +++ b/src/config.c @@ -88,7 +88,7 @@ int HostNumber = 0; /* needs to be set to 0 */ bool NoBackupOkay; bool StrictPasswords; int BadPassLimit; -int BadPassTimeout; +time_t BadPassTimeout; int UpdateTimeout; int ExpireTimeout; int ReadTimeout; @@ -641,6 +641,7 @@ int ServerConfig::Read(bool bail) {"options", "nobackupokay", "no", new ValueContainerBool(&NoBackupOkay), DT_BOOLEAN, NoValidation}, {"options", "strictpasswords", "no", new ValueContainerBool(&StrictPasswords), DT_BOOLEAN, NoValidation}, {"options", "badpasslimit", "0", new ValueContainerInt(&BadPassLimit), DT_INTEGER, NoValidation}, + {"options", "badpasstimeout", "0", new ValueContainerTime(&BadPassTimeout), DT_TIME, NoValidation}, {"nickserv", "nick", "NickServ", new ValueContainerChar(&s_NickServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, {"nickserv", "description", "Nickname Registration Service", new ValueContainerChar(&desc_NickServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, {"nickserv", "database", "nick.db", new ValueContainerChar(&NickDBName), DT_CHARPTR, ValidateNotEmpty}, @@ -1352,7 +1353,6 @@ bool ValueItem::GetBool() /*************************************************************************/ Directive directives[] = { - {"BadPassTimeout", {{PARAM_TIME, PARAM_RELOAD, &BadPassTimeout}}}, {"DumpCore", {{PARAM_SET, 0, &DumpCore}}}, {"ExpireTimeout", {{PARAM_TIME, PARAM_RELOAD, &ExpireTimeout}}}, {"ForceForbidReason", {{PARAM_SET, PARAM_RELOAD, &ForceForbidReason}}}, |