diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-17 02:02:10 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-17 02:02:10 +0000 |
commit | e0de3da4100eb3f2bccc6ac27a46733b5b2be3dc (patch) | |
tree | 55b8037760992fa99275625bca7a3f9b407de6aa /src/modules | |
parent | 8826f2b0ec596f3394ce636651d4f08437b10f3c (diff) |
Hide SSL= line of 005 if <gnutls:showports>/<openssl:showports> is false
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12484 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 27 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 31 |
2 files changed, 33 insertions, 25 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 01e700885..07e11aaa7 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -183,21 +183,26 @@ class ModuleSSLGnuTLS : public Module { sslports.clear(); - for (size_t i = 0; i < ServerInstance->ports.size(); i++) + ConfigTag* Conf = ServerInstance->Config->ConfValue("gnutls"); + + if (Conf->getBool("showports", true)) { - ListenSocket* port = ServerInstance->ports[i]; - if (port->bind_tag->getString("ssl") != "gnutls") - continue; + for (size_t i = 0; i < ServerInstance->ports.size(); i++) + { + ListenSocket* port = ServerInstance->ports[i]; + if (port->bind_tag->getString("ssl") != "gnutls") + continue; - const std::string& portid = port->bind_desc; - ServerInstance->Logs->Log("m_ssl_gnutls", DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %s", portid.c_str()); + const std::string& portid = port->bind_desc; + ServerInstance->Logs->Log("m_ssl_gnutls", DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %s", portid.c_str()); - if (port->bind_tag->getString("type", "clients") == "clients" && port->bind_addr != "127.0.0.1") - sslports.append(portid).append(";"); - } + if (port->bind_tag->getString("type", "clients") == "clients" && port->bind_addr != "127.0.0.1") + sslports.append(portid).append(";"); + } - if (!sslports.empty()) - sslports.erase(sslports.end() - 1); + if (!sslports.empty()) + sslports.erase(sslports.end() - 1); + } } void OnModuleRehash(User* user, const std::string ¶m) diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index e099facd3..a0302fa9c 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -137,24 +137,27 @@ class ModuleSSLOpenSSL : public Module void OnRehash(User* user) { - ConfigReader Conf; - sslports.clear(); - for (size_t i = 0; i < ServerInstance->ports.size(); i++) + ConfigTag* Conf = ServerInstance->Config->ConfValue("openssl"); + + if (Conf->getBool("showports", true)) { - ListenSocket* port = ServerInstance->ports[i]; - if (port->bind_tag->getString("ssl") != "openssl") - continue; - - std::string portid = port->bind_desc; - ServerInstance->Logs->Log("m_ssl_openssl", DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %s", portid.c_str()); - if (port->bind_tag->getString("type", "clients") == "clients" && port->bind_addr != "127.0.0.1") - sslports.append(portid).append(";"); - } + for (size_t i = 0; i < ServerInstance->ports.size(); i++) + { + ListenSocket* port = ServerInstance->ports[i]; + if (port->bind_tag->getString("ssl") != "openssl") + continue; + + std::string portid = port->bind_desc; + ServerInstance->Logs->Log("m_ssl_openssl", DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %s", portid.c_str()); + if (port->bind_tag->getString("type", "clients") == "clients" && port->bind_addr != "127.0.0.1") + sslports.append(portid).append(";"); + } - if (!sslports.empty()) - sslports.erase(sslports.end() - 1); + if (!sslports.empty()) + sslports.erase(sslports.end() - 1); + } } void OnModuleRehash(User* user, const std::string ¶m) |