diff options
-rw-r--r-- | Changes | 3 | ||||
-rw-r--r-- | Changes.conf | 6 | ||||
-rw-r--r-- | data/example.conf | 7 | ||||
-rw-r--r-- | include/extern.h | 7 | ||||
-rw-r--r-- | src/config.c | 2 | ||||
-rw-r--r-- | src/core/ns_register.c | 5 |
6 files changed, 27 insertions, 3 deletions
@@ -28,6 +28,9 @@ Provided by Anope Dev. <dev@anope.org> - 2006 Provided by ThaPrince <jon@vile.com> - 2006 05/19 A Plexus 3 support. [ #00] +Provided by Trystan <trystan@nomadirc.net> - 2006 +06/15 F NS Resend delay. [ #00] + Anope Version 1.7.14 -------------------- Provided by Anope Dev. <dev@anope.org> - 2006 diff --git a/Changes.conf b/Changes.conf index fc257f05d..5a34749cf 100644 --- a/Changes.conf +++ b/Changes.conf @@ -1,6 +1,12 @@ Anope Version S V N -------------------- ** ADDED CONFIGURATION DIRECTIVES ** +# NSResendDelay <time> [RECOMMENDED] +# Sets the minimum length of time between consecutive uses of the +# RESEND command. If not given, this restriction is disabled (note +# that this allows "resend flooding" or "mail bombing"). + +NSResendDelay 90s ** MODIFIED CONFIGURATION DIRECTIVES ** diff --git a/data/example.conf b/data/example.conf index 30f2d1430..68d468f13 100644 --- a/data/example.conf +++ b/data/example.conf @@ -725,6 +725,13 @@ NSDefLanguage 1 NSRegDelay 30s +# NSResendDelay <time> [RECOMMENDED] +# Sets the minimum length of time between consecutive uses of the +# RESEND command. If not given, this restriction is disabled (note +# that this allows "resend flooding" or "mail bombing"). + +NSResendDelay 90s + # NSExpire <time> [RECOMMENDED] # Sets the length of time before a nick registration expires. diff --git a/include/extern.h b/include/extern.h index 54a6bb974..d94139cd3 100644 --- a/include/extern.h +++ b/include/extern.h @@ -348,6 +348,7 @@ E int DontQuoteAddresses; E int NSDefFlags; E int NSDefLanguage; E int NSRegDelay; +E int NSResendDelay; E int NSExpire; E int NSRExpire; E int NSForceEmail; @@ -1345,9 +1346,9 @@ E void eventprintf(char *fmt, ...); E void event_process_hook(const char *name, int argc, char **argv); E void send_event(const char *name, int argc, ...); -#ifdef _WIN32
-E char *GetWindowsVersion(void) ;
-E int SupportedWindowsVersion(void);
+#ifdef _WIN32 +E char *GetWindowsVersion(void) ; +E int SupportedWindowsVersion(void); #endif #endif /* EXTERN_H */ diff --git a/src/config.c b/src/config.c index 3efdc5555..d8e05a157 100644 --- a/src/config.c +++ b/src/config.c @@ -145,6 +145,7 @@ int NSDefMemoReceive; int NSDefFlags; int NSDefLanguage; int NSRegDelay; +int NSResendDelay; int NSExpire; int NSRExpire; int NSForceEmail; @@ -555,6 +556,7 @@ Directive directives[] = { {"NSMaxAliases", {{PARAM_INT, PARAM_RELOAD, &NSMaxAliases}}}, {"NSNoGroupChange", {{PARAM_SET, PARAM_RELOAD, &NSNoGroupChange}}}, {"NSRegDelay", {{PARAM_TIME, PARAM_RELOAD, &NSRegDelay}}}, + {"NSResendDelay", {{PARAM_TIME, PARAM_RELOAD, &NSResendDelay}}}, {"NSReleaseTimeout", {{PARAM_TIME, PARAM_RELOAD, &NSReleaseTimeout}}}, {"NSSecureAdmins", {{PARAM_SET, PARAM_RELOAD, &NSSecureAdmins}}}, {"NSStrictPrivileges", diff --git a/src/core/ns_register.c b/src/core/ns_register.c index 4eb26c625..f2b3f1ad8 100644 --- a/src/core/ns_register.c +++ b/src/core/ns_register.c @@ -449,6 +449,11 @@ int do_resend(User * u) NickRequest *nr = NULL; if (NSEmailReg) { if ((nr = findrequestnick(u->nick))) { + if (time(NULL) < nr->lastmail + NSResendDelay) { + return MOD_CONT; + } else { + nr->lastmail = time(NULL); + } if (do_sendregmail(u, nr) == 0) { notice_lang(s_NickServ, u, NICK_REG_RESENT, nr->email); alog("%s: re-sent registration verification code for %s to %s", s_NickServ, nr->nick, nr->email); |