diff options
author | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-22 23:48:50 +0000 |
---|---|---|
committer | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-22 23:48:50 +0000 |
commit | 3a72729e036da4408c9e2c67dddf487224a2a696 (patch) | |
tree | c08604ea8c12993dafb60d08e26ffa6cda684e69 /src/modules/extra | |
parent | 476e879097234ded77788a262eb1ef5fd981e6bb (diff) |
Module class has a member ServerInstance, so remove any extra refs still lingering in a few modules.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7123 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra')
-rw-r--r-- | src/modules/extra/m_sqlauth.cpp | 19 | ||||
-rw-r--r-- | src/modules/extra/m_sqllog.cpp | 9 | ||||
-rw-r--r-- | src/modules/extra/m_sqloper.cpp | 11 |
3 files changed, 18 insertions, 21 deletions
diff --git a/src/modules/extra/m_sqlauth.cpp b/src/modules/extra/m_sqlauth.cpp index 8b8073f2d..530d84c57 100644 --- a/src/modules/extra/m_sqlauth.cpp +++ b/src/modules/extra/m_sqlauth.cpp @@ -23,7 +23,6 @@ class ModuleSQLAuth : public Module { - InspIRCd* Srv; Module* SQLutils; Module* SQLprovider; @@ -39,7 +38,7 @@ class ModuleSQLAuth : public Module public: ModuleSQLAuth(InspIRCd* Me) - : Module::Module(Me), Srv(Me) + : Module::Module(Me) { ServerInstance->UseInterface("SQLutils"); ServerInstance->UseInterface("SQL"); @@ -48,7 +47,7 @@ public: if (!SQLutils) throw ModuleException("Can't find m_sqlutils.so. Please load m_sqlutils.so before m_sqlauth.so."); - SQLprovider = Srv->FindFeature("SQL"); + SQLprovider = ServerInstance->FindFeature("SQL"); if (!SQLprovider) throw ModuleException("Can't find an SQL provider module. Please load one before attempting to load m_sqlauth."); @@ -68,7 +67,7 @@ public: virtual void OnRehash(userrec* user, const std::string ¶meter) { - ConfigReader Conf(Srv); + ConfigReader Conf(ServerInstance); usertable = Conf.ReadValue("sqlauth", "usertable", 0); /* User table name */ databaseid = Conf.ReadValue("sqlauth", "dbid", 0); /* Database ID, given to the SQL service provider */ @@ -89,7 +88,7 @@ public: virtual int OnUserRegister(userrec* user) { - if ((allowpattern != "") && (Srv->MatchText(user->nick,allowpattern))) + if ((allowpattern != "") && (ServerInstance->MatchText(user->nick,allowpattern))) { user->Extend("sqlauthed"); return 0; @@ -97,7 +96,7 @@ public: if (!CheckCredentials(user)) { - userrec::QuitUser(Srv,user,killreason); + userrec::QuitUser(ServerInstance,user,killreason); return 1; } return 0; @@ -123,7 +122,7 @@ public: else { if (verbose) - Srv->WriteOpers("Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, user->host, req.error.Str()); + ServerInstance->WriteOpers("Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, user->host, req.error.Str()); return false; } } @@ -149,13 +148,13 @@ public: else if (verbose) { /* No rows in result, this means there was no record matching the user */ - Srv->WriteOpers("Forbidden connection from %s!%s@%s (SQL query returned no matches)", user->nick, user->ident, user->host); + ServerInstance->WriteOpers("Forbidden connection from %s!%s@%s (SQL query returned no matches)", user->nick, user->ident, user->host); user->Extend("sqlauth_failed"); } } else if (verbose) { - Srv->WriteOpers("Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, user->host, res->error.Str()); + ServerInstance->WriteOpers("Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, user->host, res->error.Str()); user->Extend("sqlauth_failed"); } } @@ -166,7 +165,7 @@ public: if (!user->GetExt("sqlauthed")) { - userrec::QuitUser(Srv,user,killreason); + userrec::QuitUser(ServerInstance,user,killreason); } return SQLSUCCESS; } diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp index b4e5d2331..d48da1703 100644 --- a/src/modules/extra/m_sqllog.cpp +++ b/src/modules/extra/m_sqllog.cpp @@ -177,12 +177,11 @@ public: class ModuleSQLLog : public Module { - InspIRCd* Srv; ConfigReader* Conf; public: ModuleSQLLog(InspIRCd* Me) - : Module::Module(Me), Srv(Me) + : Module::Module(Me) { ServerInstance->UseInterface("SQLutils"); ServerInstance->UseInterface("SQL"); @@ -191,7 +190,7 @@ class ModuleSQLLog : public Module if (!SQLutils) throw ModuleException("Can't find m_sqlutils.so. Please load m_sqlutils.so before m_sqlauth.so."); - SQLModule = Srv->FindFeature("SQL"); + SQLModule = ServerInstance->FindFeature("SQL"); OnRehash(NULL,""); MyMod = this; @@ -213,7 +212,7 @@ class ModuleSQLLog : public Module void ReadConfig() { - ConfigReader Conf(Srv); + ConfigReader Conf(ServerInstance); dbid = Conf.ReadValue("sqllog","dbid",0); // database id of a database configured in sql module } @@ -297,7 +296,7 @@ class ModuleSQLLog : public Module virtual void OnLoadModule(Module* mod, const std::string &name) { - AddLogEntry(LT_LOADMODULE,name,Srv->Config->ServerName, Srv->Config->ServerName); + AddLogEntry(LT_LOADMODULE,name,ServerInstance->Config->ServerName, ServerInstance->Config->ServerName); } virtual Version GetVersion() diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp index 53f3c56c7..c6ce500e6 100644 --- a/src/modules/extra/m_sqloper.cpp +++ b/src/modules/extra/m_sqloper.cpp @@ -27,14 +27,13 @@ class ModuleSQLOper : public Module { - InspIRCd* Srv; Module* SQLutils; Module* HashModule; std::string databaseid; public: ModuleSQLOper(InspIRCd* Me) - : Module::Module(Me), Srv(Me) + : Module::Module(Me) { ServerInstance->UseInterface("SQLutils"); ServerInstance->UseInterface("SQL"); @@ -66,7 +65,7 @@ public: virtual void OnRehash(userrec* user, const std::string ¶meter) { - ConfigReader Conf(Srv); + ConfigReader Conf(ServerInstance); databaseid = Conf.ReadValue("sqloper", "dbid", 0); /* Database ID of a database configured for the service provider module */ } @@ -92,7 +91,7 @@ public: { Module* target; - target = Srv->FindFeature("SQL"); + target = ServerInstance->FindFeature("SQL"); if (target) { @@ -243,7 +242,7 @@ public: bool OperUser(userrec* user, const std::string &username, const std::string &password, const std::string &pattern, const std::string &type) { - ConfigReader Conf(Srv); + ConfigReader Conf(ServerInstance); for (int j = 0; j < Conf.Enumerate("type"); j++) { @@ -260,7 +259,7 @@ public: if (operhost.size()) user->ChangeDisplayedHost(operhost.c_str()); - Srv->SNO->WriteToSnoMask('o',"%s (%s@%s) is now an IRC operator of type %s", user->nick, user->ident, user->host, type.c_str()); + ServerInstance->SNO->WriteToSnoMask('o',"%s (%s@%s) is now an IRC operator of type %s", user->nick, user->ident, user->host, type.c_str()); user->WriteServ("381 %s :You are now an IRC operator of type %s", user->nick, type.c_str()); if (!user->modes[UM_OPERATOR]) |