summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-07-24 18:29:43 +0100
committerPeter Powell <petpow@saberuk.com>2018-07-24 21:55:10 +0100
commit97a1d6429a735eb279496df010d04e3f42aa4e22 (patch)
treea201d8ffe678e5929a2b1d373eef8082d8c6150d /src/modules/extra
parent7a24867d97c6ffe75b155d96dedb11b30b904a33 (diff)
Make more config stuff case insensitive.
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_ldap.cpp6
-rw-r--r--src/modules/extra/m_mysql.cpp2
-rw-r--r--src/modules/extra/m_pgsql.cpp2
-rw-r--r--src/modules/extra/m_regex_stdlib.cpp12
-rw-r--r--src/modules/extra/m_sqlite3.cpp2
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp8
-rw-r--r--src/modules/extra/m_ssl_mbedtls.cpp2
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp6
8 files changed, 20 insertions, 20 deletions
diff --git a/src/modules/extra/m_ldap.cpp b/src/modules/extra/m_ldap.cpp
index f3ace5409..8c2752dbf 100644
--- a/src/modules/extra/m_ldap.cpp
+++ b/src/modules/extra/m_ldap.cpp
@@ -258,9 +258,9 @@ class LDAPService : public LDAPProvider, public SocketThread
, con(NULL), config(tag), last_connect(0)
{
std::string scope = config->getString("searchscope");
- if (scope == "base")
+ if (stdalgo::string::equalsci(scope, "base"))
searchscope = LDAP_SCOPE_BASE;
- else if (scope == "onelevel")
+ else if (stdalgo::string::equalsci(scope, "onelevel"))
searchscope = LDAP_SCOPE_ONELEVEL;
else
searchscope = LDAP_SCOPE_SUBTREE;
@@ -533,7 +533,7 @@ class ModuleLDAP : public Module
{
const reference<ConfigTag>& tag = i->second;
- if (tag->getString("module") != "ldap")
+ if (!stdalgo::string::equalsci(tag->getString("module"), "ldap"))
continue;
std::string id = tag->getString("id");
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index 9f17c1426..45ba67e4e 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -427,7 +427,7 @@ void ModuleSQL::ReadConfig(ConfigStatus& status)
ConfigTagList tags = ServerInstance->Config->ConfTags("database");
for(ConfigIter i = tags.first; i != tags.second; i++)
{
- if (i->second->getString("module", "mysql") != "mysql")
+ if (!stdalgo::string::equalsci(i->second->getString("provider"), "mysql"))
continue;
std::string id = i->second->getString("id");
ConnMap::iterator curr = connections.find(id);
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp
index 8beea1265..220168b84 100644
--- a/src/modules/extra/m_pgsql.cpp
+++ b/src/modules/extra/m_pgsql.cpp
@@ -546,7 +546,7 @@ class ModulePgSQL : public Module
ConfigTagList tags = ServerInstance->Config->ConfTags("database");
for(ConfigIter i = tags.first; i != tags.second; i++)
{
- if (i->second->getString("module", "pgsql") != "pgsql")
+ if (!stdalgo::string::equalsci(i->second->getString("provider"), "pgsql"))
continue;
std::string id = i->second->getString("id");
ConnMap::iterator curr = connections.find(id);
diff --git a/src/modules/extra/m_regex_stdlib.cpp b/src/modules/extra/m_regex_stdlib.cpp
index 7a888ed72..42e5c8bf1 100644
--- a/src/modules/extra/m_regex_stdlib.cpp
+++ b/src/modules/extra/m_regex_stdlib.cpp
@@ -74,19 +74,19 @@ public:
ConfigTag* Conf = ServerInstance->Config->ConfValue("stdregex");
std::string regextype = Conf->getString("type", "ecmascript");
- if(regextype == "bre")
+ if (stdalgo::string::equalsci(regextype, "bre"))
ref.regextype = std::regex::basic;
- else if(regextype == "ere")
+ else if (stdalgo::string::equalsci(regextype, "ere"))
ref.regextype = std::regex::extended;
- else if(regextype == "awk")
+ else if (stdalgo::string::equalsci(regextype, "awk"))
ref.regextype = std::regex::awk;
- else if(regextype == "grep")
+ else if (stdalgo::string::equalsci(regextype, "grep"))
ref.regextype = std::regex::grep;
- else if(regextype == "egrep")
+ else if (stdalgo::string::equalsci(regextype, "egrep"))
ref.regextype = std::regex::egrep;
else
{
- if(regextype != "ecmascript")
+ if (!stdalgo::string::equalsci(regextype, "ecmascript"))
ServerInstance->SNO->WriteToSnoMask('a', "WARNING: Non-existent regex engine '%s' specified. Falling back to ECMAScript.", regextype.c_str());
ref.regextype = std::regex::ECMAScript;
}
diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp
index 31821045d..2029181bf 100644
--- a/src/modules/extra/m_sqlite3.cpp
+++ b/src/modules/extra/m_sqlite3.cpp
@@ -254,7 +254,7 @@ class ModuleSQLite3 : public Module
ConfigTagList tags = ServerInstance->Config->ConfTags("database");
for(ConfigIter i = tags.first; i != tags.second; i++)
{
- if (i->second->getString("module", "sqlite") != "sqlite")
+ if (!stdalgo::string::equalsci(i->second->getString("provider"), "sqlite"))
continue;
SQLConn* conn = new SQLConn(this, i->second);
conns.insert(std::make_pair(i->second->getString("id"), conn));
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 51410cfb2..d7ca20742 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -184,12 +184,12 @@ namespace GnuTLS
throw Exception("Unknown hash type " + hashname);
gnutls_hash_deinit(is_digest, NULL);
#else
- if (hashname == "md5")
+ if (stdalgo::string::equalsci(hashname, "md5"))
hash = GNUTLS_DIG_MD5;
- else if (hashname == "sha1")
+ else if (stdalgo::string::equalsci(hashname, "sha1"))
hash = GNUTLS_DIG_SHA1;
#ifdef INSPIRCD_GNUTLS_ENABLE_SHA256_FINGERPRINT
- else if (hashname == "sha256")
+ else if (stdalgo::string::equalsci(hashname, "sha256"))
hash = GNUTLS_DIG_SHA256;
#endif
else
@@ -1298,7 +1298,7 @@ class ModuleSSLGnuTLS : public Module
for (ConfigIter i = tags.first; i != tags.second; ++i)
{
ConfigTag* tag = i->second;
- if (tag->getString("provider") != "gnutls")
+ if (!stdalgo::string::equalsci(tag->getString("provider"), "gnutls"))
continue;
std::string name = tag->getString("name");
diff --git a/src/modules/extra/m_ssl_mbedtls.cpp b/src/modules/extra/m_ssl_mbedtls.cpp
index 8bb0e2bbd..75b25fbc4 100644
--- a/src/modules/extra/m_ssl_mbedtls.cpp
+++ b/src/modules/extra/m_ssl_mbedtls.cpp
@@ -876,7 +876,7 @@ class ModuleSSLmbedTLS : public Module
for (ConfigIter i = tags.first; i != tags.second; ++i)
{
ConfigTag* tag = i->second;
- if (tag->getString("provider") != "mbedtls")
+ if (!stdalgo::string::equalsci(tag->getString("provider"), "mbedtls"))
continue;
std::string name = tag->getString("name");
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index a70bffb3c..5f61c71a9 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -222,11 +222,11 @@ namespace OpenSSL
/* Set CRL mode */
unsigned long crlflags = X509_V_FLAG_CRL_CHECK;
- if (crlmode == "chain")
+ if (stdalgo::string::equalsci(crlmode, "chain"))
{
crlflags |= X509_V_FLAG_CRL_CHECK_ALL;
}
- else if (crlmode != "leaf")
+ else if (!stdalgo::string::equalsci(crlmode, "leaf"))
{
throw ModuleException("Unknown mode '" + crlmode + "'; expected either 'chain' (default) or 'leaf'");
}
@@ -963,7 +963,7 @@ class ModuleSSLOpenSSL : public Module
for (ConfigIter i = tags.first; i != tags.second; ++i)
{
ConfigTag* tag = i->second;
- if (tag->getString("provider") != "openssl")
+ if (!stdalgo::string::equalsci(tag->getString("provider"), "openssl"))
continue;
std::string name = tag->getString("name");