X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_sqloper.cpp;h=520869e210b3074d1fa02ffe3f6f0a34a7a19d24;hb=d556a4f8740b65e635ff7d2b976faaedbdac51d4;hp=53f3c56c7a3b0d9581aa4cf8204b2444353fd46f;hpb=76d7e8a0684b38a82e6c05ebd7538b69660e1bef;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp index 53f3c56c7..520869e21 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]) @@ -280,27 +279,5 @@ public: }; -class ModuleSQLOperFactory : public ModuleFactory -{ - public: - ModuleSQLOperFactory() - { - } - - ~ModuleSQLOperFactory() - { - } - - virtual Module * CreateModule(InspIRCd* Me) - { - return new ModuleSQLOper(Me); - } - -}; - - -extern "C" void * init_module( void ) -{ - return new ModuleSQLOperFactory; -} +MODULE_INIT(ModuleSQLOper);