]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sqloper.cpp
Replace some C-isms with C++-isms.
[user/henk/code/inspircd.git] / src / modules / m_sqloper.cpp
index b5b020d9d6807a79a9e081d8446768a262141566..87ab7d46f32f54a88199ff979127e1a23a7665d3 100644 (file)
 
 /* $ModDesc: Allows storage of oper credentials in an SQL table */
 
-static bool OneOfMatches(const char* host, const char* ip, const std::string& hostlist)
-{
-       std::stringstream hl(hostlist);
-       std::string xhost;
-       while (hl >> xhost)
-       {
-               if (InspIRCd::Match(host, xhost, ascii_case_insensitive_map) || InspIRCd::MatchCIDR(ip, xhost, ascii_case_insensitive_map))
-               {
-                       return true;
-               }
-       }
-       return false;
-}
-
 class OpMeQuery : public SQLQuery
 {
  public:
@@ -106,7 +92,7 @@ class OpMeQuery : public SQLQuery
 
                hostname.append("@").append(user->host);
 
-               if (OneOfMatches(hostname.c_str(), user->GetIPString().c_str(), pattern.c_str()))
+               if (InspIRCd::MatchMask(pattern, hostname, user->GetIPString()))
                {
                        /* Opertype and host match, looks like this is it. */