summaryrefslogtreecommitdiff
path: root/src/modules/m_sqloper.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2013-05-06 11:49:50 +0100
committerPeter Powell <petpow@saberuk.com>2013-05-15 03:32:56 +0100
commitaccccc212cd4f08a3c5532b1ae7a17e76bac8718 (patch)
tree18f4370778cc79d2f21a4308dafbb29a77cfa213 /src/modules/m_sqloper.cpp
parent23e8bba13c55d33ce89d505780da36c9589e300a (diff)
Replace some C-isms with C++-isms.
* 'const char*' to 'const std::string&'. * snprintf to std::string concatenation. * Replace duplicated OneOfMatches with InspIRCd::MatchMask.
Diffstat (limited to 'src/modules/m_sqloper.cpp')
-rw-r--r--src/modules/m_sqloper.cpp16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/modules/m_sqloper.cpp b/src/modules/m_sqloper.cpp
index b5b020d9d..87ab7d46f 100644
--- a/src/modules/m_sqloper.cpp
+++ b/src/modules/m_sqloper.cpp
@@ -23,20 +23,6 @@
/* $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. */