]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sqloper.cpp
Hide User#host and User#dhost and use accessors to modify them.
[user/henk/code/inspircd.git] / src / modules / m_sqloper.cpp
index d6581682c958b2abc4223d745e37f70a8c45825c..b6aa90f490f080819611a27795a463c95c45bfca 100644 (file)
@@ -88,7 +88,7 @@ class OpMeQuery : public SQLQuery
 
                std::string hostname(user->ident);
 
-               hostname.append("@").append(user->host);
+               hostname.append("@").append(user->GetRealHost());
 
                if (InspIRCd::MatchMask(pattern, hostname, user->GetIPString()))
                {
@@ -122,7 +122,7 @@ public:
                        SQL.SetProvider("SQL/" + dbid);
 
                hashtype = tag->getString("hash");
-               query = tag->getString("query", "SELECT hostname as host, type FROM ircd_opers WHERE username='$username' AND password='$password'");
+               query = tag->getString("query", "SELECT hostname as host, type FROM ircd_opers WHERE username='$username' AND password='$password' AND active=1;");
        }
 
        ModResult OnPreCommand(std::string &command, std::vector<std::string> &parameters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE
@@ -147,7 +147,7 @@ public:
                ParamM userinfo;
                SQL->PopulateUserInfo(user, userinfo);
                userinfo["username"] = username;
-               userinfo["password"] = hash ? hash->hexsum(password) : password;
+               userinfo["password"] = hash ? hash->Generate(password) : password;
 
                SQL->submit(new OpMeQuery(this, user->uuid, username, password), query, userinfo);
        }