mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 18:49:03 -04:00
Add requireident/requiressl to connect blocks
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12353 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
8e34d66ef3
commit
f288993a85
@ -275,9 +275,13 @@
|
||||
# module be loaded as well.
|
||||
modes="+x"
|
||||
|
||||
# requireident/requiressl: require that users of this block use SSL or
|
||||
# have a valid ident response. Requires m_ident or m_sslinfo
|
||||
requiressl="on"
|
||||
|
||||
# port: What port this user is allowed to connect on. (optional)
|
||||
# The port MUST be set to listen in the bind blocks above.
|
||||
port="6667">
|
||||
port="6697">
|
||||
|
||||
<connect
|
||||
# name: Name to use for this connect block. Mainly used for
|
||||
|
@ -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 */
|
||||
|
@ -127,8 +127,8 @@ class ModuleSSLInfo : public Module
|
||||
|
||||
ServerInstance->Extensions.Register(&cmd.CertExt);
|
||||
|
||||
Implementation eventlist[] = { I_OnWhois, I_OnPreCommand };
|
||||
ServerInstance->Modules->Attach(eventlist, this, 2);
|
||||
Implementation eventlist[] = { I_OnWhois, I_OnPreCommand, I_OnSetConnectClass };
|
||||
ServerInstance->Modules->Attach(eventlist, this, 3);
|
||||
}
|
||||
|
||||
Version GetVersion()
|
||||
@ -191,6 +191,13 @@ class ModuleSSLInfo : public Module
|
||||
return MOD_RES_PASSTHRU;
|
||||
}
|
||||
|
||||
ModResult OnSetConnectClass(LocalUser* user, ConnectClass* myclass)
|
||||
{
|
||||
if (myclass->config->getBool("requiressl") && !cmd.CertExt.get(user))
|
||||
return MOD_RES_DENY;
|
||||
return MOD_RES_PASSTHRU;
|
||||
}
|
||||
|
||||
void OnRequest(Request& request)
|
||||
{
|
||||
if (strcmp("GET_USER_CERT", request.id) == 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user