summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-02 19:03:16 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-02 19:03:16 +0000
commit7487030d1e9120b3ffcecde064740ba36de9d8d0 (patch)
tree4bce127d9c42202fbdfdf79d0f96626b9cd16430 /src/modules
parent9d4004e8d477232c143830508a7a6e41fd2d31b7 (diff)
Add requiresasl to connect block checks
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12356 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_sasl.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp
index 28a583c80..4dcb350bc 100644
--- a/src/modules/m_sasl.cpp
+++ b/src/modules/m_sasl.cpp
@@ -226,8 +226,8 @@ class ModuleSASL : public Module
ModuleSASL()
: authExt("sasl_auth", this), cap(this, "sasl"), auth(this, authExt, cap), sasl(this, authExt)
{
- Implementation eventlist[] = { I_OnEvent, I_OnUserRegister };
- ServerInstance->Modules->Attach(eventlist, this, 2);
+ Implementation eventlist[] = { I_OnEvent, I_OnUserRegister, I_OnSetConnectClass };
+ ServerInstance->Modules->Attach(eventlist, this, 3);
ServiceProvider* providelist[] = { &auth, &sasl, &authExt };
ServerInstance->Modules->AddServices(providelist, 3);
@@ -248,6 +248,17 @@ class ModuleSASL : public Module
return MOD_RES_PASSTHRU;
}
+ ModResult OnSetConnectClass(LocalUser* user, ConnectClass* myclass)
+ {
+ if (myclass->config->getBool("requiresasl"))
+ {
+ AccountExtItem* ext = GetAccountExtItem();
+ if (ext && !ext.get(user))
+ return MOD_RES_DENY;
+ }
+ return MOD_RES_PASSTHRU;
+ }
+
~ModuleSASL()
{
}