diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-03-13 01:28:54 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-03-13 01:28:54 +0000 |
commit | 11e45f2cb78c0667e2c7c7e2370944bf64b140b8 (patch) | |
tree | 54a9da96d4911112fa2d5b1669ee1d661e9a1bb4 /src/modules/m_sqloper.cpp | |
parent | a115cb04b75b27c661551b6395e79b4d96d0fdef (diff) |
Convert pgsql to SQLv3
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12626 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_sqloper.cpp')
-rw-r--r-- | src/modules/m_sqloper.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/modules/m_sqloper.cpp b/src/modules/m_sqloper.cpp index 66fb0550e..307f72f3c 100644 --- a/src/modules/m_sqloper.cpp +++ b/src/modules/m_sqloper.cpp @@ -35,15 +35,15 @@ class OpMeQuery : public SQLQuery { public: const std::string uid, username, password; - OpMeQuery(Module* me, const std::string& db, const std::string& q, const std::string& u, const std::string& un, const std::string& pw) - : SQLQuery(me, db, q), uid(u), username(un), password(pw) + OpMeQuery(Module* me, const std::string& q, const std::string& u, const std::string& un, const std::string& pw) + : SQLQuery(me, q), uid(u), username(un), password(pw) { - ServerInstance->Logs->Log("m_sqloper",DEBUG, "SQLOPER: db=%s query=\"%s\"", db.c_str(), q.c_str()); + ServerInstance->Logs->Log("m_sqloper",DEBUG, "SQLOPER: query=\"%s\"", q.c_str()); } void OnResult(SQLResult& res) { - ServerInstance->Logs->Log("m_sqloper",DEBUG, "SQLOPER: result on db=%s for %s", dbid.c_str(), uid.c_str()); + ServerInstance->Logs->Log("m_sqloper",DEBUG, "SQLOPER: result for %s", uid.c_str()); User* user = ServerInstance->FindNick(uid); if (!user) return; @@ -128,7 +128,6 @@ class OpMeQuery : public SQLQuery class ModuleSQLOper : public Module { - std::string databaseid; std::string query; std::string hashtype; dynamic_reference<SQLProvider> SQL; @@ -148,7 +147,8 @@ public: { ConfigTag* tag = ServerInstance->Config->ConfValue("sqloper"); - databaseid = tag->getString("dbid"); + SQL.SetProvider("SQL/" + tag->getString("dbid")); + SQL.lookup(); hashtype = tag->getString("hash"); query = tag->getString("query", "SELECT hostname as host, type FROM ircd_opers WHERE username='$username' AND password='$password'"); } @@ -173,7 +173,7 @@ public: userinfo["username"] = username; userinfo["password"] = hash ? hash->hexsum(password) : password; - SQL->submit(new OpMeQuery(this, databaseid, SQL->FormatQuery(query, userinfo), user->uuid, username, password)); + SQL->submit(new OpMeQuery(this, SQL->FormatQuery(query, userinfo), user->uuid, username, password)); } Version GetVersion() |