diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-03-06 18:01:29 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-03-06 18:01:29 +0000 |
commit | cb0fcc235bf12b80af22088997b7f5a9a605109f (patch) | |
tree | 8c6fd0600962dc20abab63fc387b5e00f95459c4 | |
parent | d81c373961a61871899736b27e67c9341ff6231f (diff) |
Add some useful logging output to m_sqloper
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12604 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_sqloper.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/modules/m_sqloper.cpp b/src/modules/m_sqloper.cpp index 281593cfa..3b2f67196 100644 --- a/src/modules/m_sqloper.cpp +++ b/src/modules/m_sqloper.cpp @@ -36,10 +36,14 @@ 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) {} + : SQLQuery(me, db, q), uid(u), username(un), password(pw) + { + ServerInstance->Logs->Log("m_sqloper",DEBUG, "SQLOPER: db=%s query=\"%s\"", db.c_str(), 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()); User* user = ServerInstance->FindNick(uid); if (!user) return; @@ -48,9 +52,10 @@ class OpMeQuery : public SQLQuery parameterlist row; while (res.GetRow(row)) { - if (OperUser(user, row[2], row[3])) + if (OperUser(user, row[0], row[1])) return; } + ServerInstance->Logs->Log("m_sqloper",DEBUG, "SQLOPER: no matches for %s (checked %d rows)", uid.c_str(), res.Rows()); // nobody succeeded... fall back to OPER fallback(); } @@ -85,7 +90,10 @@ class OpMeQuery : public SQLQuery { OperIndex::iterator iter = ServerInstance->Config->oper_blocks.find(" " + type); if (iter == ServerInstance->Config->oper_blocks.end()) + { + ServerInstance->Logs->Log("m_sqloper",DEFAULT, "SQLOPER: bad type '%s' in returned row for oper %s", type.c_str(), username.c_str()); return false; + } OperInfo* ifo = iter->second; std::string hostname(user->ident); @@ -149,7 +157,7 @@ public: params.push_back(hash ? hash->hexsum(password) : password); SQL->submit(new OpMeQuery(this, databaseid, SQL->FormatQuery( - "SELECT username, password, hostname, type FROM ircd_opers WHERE username = '?' AND password='?'", params + "SELECT hostname, type FROM ircd_opers WHERE username = '?' AND password='?'", params ), user->uuid, username, password)); } |