summaryrefslogtreecommitdiff
path: root/src/modules/m_ident.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-02 15:02:42 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-02 15:02:42 +0000
commitf288993a85681c09e3d92d8c3ab9742826923e99 (patch)
treedd1884fdf2581bef34e105a05f9913be78ee146e /src/modules/m_ident.cpp
parent8e34d66ef3bef802e5758ad73ff29e1b75aaba7f (diff)
Add requireident/requiressl to connect blocks
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12353 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_ident.cpp')
-rw-r--r--src/modules/m_ident.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp
index ead8a2021..d20c9d8dd 100644
--- a/src/modules/m_ident.cpp
+++ b/src/modules/m_ident.cpp
@@ -280,8 +280,11 @@ class ModuleIdent : public Module
ModuleIdent() : ext("ident_socket", this)
{
OnRehash(NULL);
- Implementation eventlist[] = { I_OnRehash, I_OnUserRegister, I_OnCheckReady, I_OnUserDisconnect };
- ServerInstance->Modules->Attach(eventlist, this, 4);
+ Implementation eventlist[] = {
+ I_OnRehash, I_OnUserRegister, I_OnCheckReady,
+ I_OnUserDisconnect, I_OnSetConnectClass
+ };
+ ServerInstance->Modules->Attach(eventlist, this, 5);
}
~ModuleIdent()
@@ -384,6 +387,13 @@ class ModuleIdent : public Module
return MOD_RES_PASSTHRU;
}
+ ModResult OnSetConnectClass(LocalUser* user, ConnectClass* myclass)
+ {
+ if (myclass->config->getBool("requireident") && user->ident[0] == '~')
+ return MOD_RES_DENY;
+ return MOD_RES_PASSTHRU;
+ }
+
virtual void OnCleanup(int target_type, void *item)
{
/* Module unloading, tidy up users */