diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-09 04:57:13 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-09 04:57:13 +0000 |
commit | 2bebd9500a2e27844df6bc148f6d8aaad0dd7943 (patch) | |
tree | 99f91bc479c6f358f492bd0d9a4316f7674f7098 | |
parent | a5e2250a2cda1face90c3fe66ece183018d8ac95 (diff) |
Change <connect:requiresasl> to <connect:requireaccount>, which is more accurate
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12408 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | docs/inspircd.conf.example | 10 | ||||
-rw-r--r-- | src/modules/m_sasl.cpp | 19 | ||||
-rw-r--r-- | src/modules/m_services_account.cpp | 9 |
3 files changed, 15 insertions, 23 deletions
diff --git a/docs/inspircd.conf.example b/docs/inspircd.conf.example index 0b8c466ad..5a5a6c7c5 100644 --- a/docs/inspircd.conf.example +++ b/docs/inspircd.conf.example @@ -275,11 +275,15 @@ # module be loaded as well. modes="+x" - # requireident, requiressl, requiresasl: require that users of this - # block have a valid ident response, use SSL, or have authenticated with SASL. - # Requires m_ident, m_sslinfo, or m_sasl respectively + # requireident, requiressl, requireaccount: require that users of this + # block have a valid ident response, use SSL, or have authenticated. + # Requires m_ident, m_sslinfo, or m_services_account respectively. requiressl="on" + # Alternate MOTD file for this connect class. The contents of this file are + # specified using <files secretmotd="filename"> or <execfiles ...> + motd="secretmotd" + # port: What port this user is allowed to connect on. (optional) # The port MUST be set to listen in the bind blocks above. port="6697"> diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 3c3b1d2a0..bb2f70448 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, I_OnSetConnectClass }; - ServerInstance->Modules->Attach(eventlist, this, 3); + Implementation eventlist[] = { I_OnEvent, I_OnUserRegister }; + ServerInstance->Modules->Attach(eventlist, this, 2); ServiceProvider* providelist[] = { &auth, &sasl, &authExt }; ServerInstance->Modules->AddServices(providelist, 3); @@ -248,21 +248,6 @@ class ModuleSASL : public Module return MOD_RES_PASSTHRU; } - ModResult OnSetConnectClass(LocalUser* user, ConnectClass* myclass) - { - if (myclass->config->getBool("requiresasl")) - { - const AccountExtItem* ext = GetAccountExtItem(); - if (ext && !ext->get(user)) - return MOD_RES_DENY; - } - return MOD_RES_PASSTHRU; - } - - ~ModuleSASL() - { - } - Version GetVersion() { return Version("Provides support for IRC Authentication Layer (aka: atheme SASL) via AUTHENTICATE.",VF_VENDOR); diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index 3f1913de4..175e18861 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -120,9 +120,9 @@ class ModuleServicesAccount : public Module ServerInstance->Modules->AddService(m5); ServerInstance->Modules->AddService(accountname); Implementation eventlist[] = { I_OnWhois, I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserPreJoin, I_OnCheckBan, - I_OnDecodeMetaData, I_On005Numeric, I_OnUserPostNick }; + I_OnDecodeMetaData, I_On005Numeric, I_OnUserPostNick, I_OnSetConnectClass }; - ServerInstance->Modules->Attach(eventlist, this, 8); + ServerInstance->Modules->Attach(eventlist, this, 9); } void On005Numeric(std::string &t) @@ -272,8 +272,11 @@ class ModuleServicesAccount : public Module } } - ~ModuleServicesAccount() + ModResult OnSetConnectClass(LocalUser* user, ConnectClass* myclass) { + if (myclass->config->getBool("requireaccount") && !accountname.get(user)) + return MOD_RES_DENY; + return MOD_RES_PASSTHRU; } Version GetVersion() |