# in this class. This can save a lot of resources on very busy servers.
resolvehostnames="yes"
+ # useconnectban: Defines if users in this class should be exempt from connectban limits.
+ # This setting only has effect when the connectban module is loaded.
+ #useconnectban="yes"
+
# usednsbl: Defines whether or not users in this class are subject to DNSBL. Default is yes.
# This setting only has effect when the dnsbl module is loaded.
#usednsbl="yes"
return 0;
}
+ static bool IsExempt(LocalUser* user)
+ {
+ // E-lined and already banned users shouldn't be hit.
+ if (user->exempt || user->quitting)
+ return true;
+
+ // Users in an exempt class shouldn't be hit.
+ return user->GetClass() && !user->GetClass()->config->getBool("useconnectban", true);
+ }
+
public:
ModuleConnectBan()
: WebIRC::EventListener(this)
void OnWebIRCAuth(LocalUser* user, const WebIRC::FlagMap* flags) CXX11_OVERRIDE
{
- if (user->exempt)
+ if (IsExempt(user))
return;
// HACK: Lower the connection attempts for the gateway IP address. The user
void OnSetUserIP(LocalUser* u) CXX11_OVERRIDE
{
- if (u->exempt || u->quitting)
+ if (IsExempt(u))
return;
irc::sockets::cidr_mask mask(u->client_sa, GetRange(u));