]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_cgiirc.cpp
Add m_starttls and remove it from m_ssl_gnutls, which allows it to work with both...
[user/henk/code/inspircd.git] / src / modules / m_cgiirc.cpp
index 88c73c424b667214f92b3465b3855231bfcc2531..5dea028fbb787c6b7f7156ee0163f4fee18e6913 100644 (file)
@@ -27,8 +27,6 @@
 #include "xline.h"
 #include "modules/dns.h"
 
-/* $ModDesc: Change user's hosts connecting from known CGI:IRC hosts */
-
 enum CGItype { PASS, IDENT, PASSFIRST, IDENTFIRST, WEBIRC };
 
 
@@ -208,7 +206,7 @@ class ModuleCgiIRC : public Module
                RecheckClass(user);
 
                // Don't create the resolver if the core couldn't put the user in a connect class or when dns is disabled
-               if (user->quitting || !DNS || user->MyClass->nouserdns)
+               if (user->quitting || !DNS || !user->MyClass->resolvehostnames)
                        return;
 
                CGIResolver* r = new CGIResolver(*this->DNS, this, cmd.notify, newip, user, (was_pass ? "PASS" : "IDENT"), waiting);
@@ -224,7 +222,7 @@ class ModuleCgiIRC : public Module
                                waiting.set(user, count - 1);
                        delete r;
                        if (cmd.notify)
-                                ServerInstance->SNO->WriteToSnoMask('a', "Connecting user %s detected as using CGI:IRC (%s), but I could not resolve their hostname; %s", user->nick.c_str(), user->host.c_str(), ex.GetReason());
+                                ServerInstance->SNO->WriteToSnoMask('a', "Connecting user %s detected as using CGI:IRC (%s), but I could not resolve their hostname; %s", user->nick.c_str(), user->host.c_str(), ex.GetReason().c_str());
                }
        }
 
@@ -236,17 +234,7 @@ public:
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               OnRehash(NULL);
-               ServiceProvider* providerlist[] = { &cmd, &cmd.realhost, &cmd.realip, &cmd.webirc_hostname, &cmd.webirc_ip, &waiting };
-               ServerInstance->Modules->AddServices(providerlist, sizeof(providerlist)/sizeof(ServiceProvider*));
-
-               Implementation eventlist[] = { I_OnRehash, I_OnUserRegister, I_OnCheckReady };
-               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
-       }
-
-       void OnRehash(User* user) CXX11_OVERRIDE
+       void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                cmd.Hosts.clear();
 
@@ -265,7 +253,7 @@ public:
                        {
                                if (type == "webirc" && password.empty())
                                {
-                                       ServerInstance->Logs->Log("CONFIG",LOG_DEFAULT, "m_cgiirc: Missing password in config: %s", hostmask.c_str());
+                                       ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "m_cgiirc: Missing password in config: %s", hostmask.c_str());
                                }
                                else
                                {
@@ -281,7 +269,7 @@ public:
                                        else
                                        {
                                                cgitype = PASS;
-                                               ServerInstance->Logs->Log("CONFIG",LOG_DEFAULT, "m_cgiirc.so: Invalid <cgihost:type> value in config: %s, setting it to \"pass\"", type.c_str());
+                                               ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "Invalid <cgihost:type> value in config: %s, setting it to \"pass\"", type.c_str());
                                        }
 
                                        cmd.Hosts.push_back(CGIhost(hostmask, cgitype, password));
@@ -289,7 +277,7 @@ public:
                        }
                        else
                        {
-                               ServerInstance->Logs->Log("CONFIG",LOG_DEFAULT, "m_cgiirc.so: Invalid <cgihost:mask> value in config: %s", hostmask.c_str());
+                               ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "Invalid <cgihost:mask> value in config: %s", hostmask.c_str());
                                continue;
                        }
                }