summaryrefslogtreecommitdiff
path: root/src/modules/m_sqlauth.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_sqlauth.cpp')
-rw-r--r--src/modules/m_sqlauth.cpp28
1 files changed, 9 insertions, 19 deletions
diff --git a/src/modules/m_sqlauth.cpp b/src/modules/m_sqlauth.cpp
index df97145be..0c055a085 100644
--- a/src/modules/m_sqlauth.cpp
+++ b/src/modules/m_sqlauth.cpp
@@ -18,10 +18,8 @@
#include "inspircd.h"
-#include "sql.h"
-#include "hash.h"
-
-/* $ModDesc: Allow/Deny connections based upon an arbitrary SQL table */
+#include "modules/sql.h"
+#include "modules/hash.h"
enum AuthState {
AUTH_STATE_NONE = 0,
@@ -39,8 +37,8 @@ class AuthQuery : public SQLQuery
: SQLQuery(me), uid(u), pendingExt(e), verbose(v)
{
}
-
- void OnResult(SQLResult& res)
+
+ void OnResult(SQLResult& res) CXX11_OVERRIDE
{
User* user = ServerInstance->FindNick(uid);
if (!user)
@@ -57,7 +55,7 @@ class AuthQuery : public SQLQuery
}
}
- void OnError(SQLerror& error)
+ void OnError(SQLerror& error) CXX11_OVERRIDE
{
User* user = ServerInstance->FindNick(uid);
if (!user)
@@ -83,15 +81,7 @@ class ModuleSQLAuth : public Module
{
}
- void init()
- {
- ServerInstance->Modules->AddService(pendingExt);
- OnRehash(NULL);
- Implementation eventlist[] = { I_OnCheckReady, I_OnRehash, I_OnUserRegister };
- ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
- }
-
- void OnRehash(User* user)
+ void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
ConfigTag* conf = ServerInstance->Config->ConfValue("sqlauth");
std::string dbid = conf->getString("dbid");
@@ -105,7 +95,7 @@ class ModuleSQLAuth : public Module
verbose = conf->getBool("verbose");
}
- ModResult OnUserRegister(LocalUser* user)
+ ModResult OnUserRegister(LocalUser* user) CXX11_OVERRIDE
{
// Note this is their initial (unresolved) connect block
ConfigTag* tag = user->MyClass->config;
@@ -144,7 +134,7 @@ class ModuleSQLAuth : public Module
return MOD_RES_PASSTHRU;
}
- ModResult OnCheckReady(LocalUser* user)
+ ModResult OnCheckReady(LocalUser* user) CXX11_OVERRIDE
{
switch (pendingExt.get(user))
{
@@ -159,7 +149,7 @@ class ModuleSQLAuth : public Module
return MOD_RES_PASSTHRU;
}
- Version GetVersion()
+ Version GetVersion() CXX11_OVERRIDE
{
return Version("Allow/Deny connections based upon an arbitrary SQL table", VF_VENDOR);
}