summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_connectban.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp
index 81b0fcfa7..b4b16f539 100644
--- a/src/modules/m_connectban.cpp
+++ b/src/modules/m_connectban.cpp
@@ -61,6 +61,16 @@ class ModuleConnectBan
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)
@@ -91,7 +101,7 @@ class ModuleConnectBan
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
@@ -105,7 +115,7 @@ class ModuleConnectBan
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));