X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_cgiirc.cpp;h=c99d6b5ebcf80b6d7fc1e496172c21c63da9b460;hb=78fa4165c90088523e623ab2b64ca0db0d19def0;hp=290f55d22df63cbf0203e76e1abc4a09acf500f9;hpb=42105f07dd1ac0e04e28077754b6245a80d55597;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 290f55d22..c99d6b5eb 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -23,7 +23,7 @@ /* $ModDesc: Change user's hosts connecting from known CGI:IRC hosts */ -enum CGItype { PASS, IDENT, PASSFIRST, IDENTFIRST, WEBIRC }; +enum CGItype { INVALID, PASS, IDENT, PASSFIRST, IDENTFIRST, WEBIRC }; /** Holds a CGI site's details @@ -91,8 +91,11 @@ class CGIResolver : public Resolver CGIResolver(Module* me, InspIRCd* ServerInstance, bool NotifyOpers, const std::string &source, bool forward, userrec* u, int userfd, const std::string &type, bool &cached) : Resolver(ServerInstance, source, forward ? DNS_QUERY_A : DNS_QUERY_PTR4, cached, me), typ(type), theirfd(userfd), them(u), notify(NotifyOpers) { } - virtual void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached) + virtual void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached, int resultnum = 0) { + if (resultnum) + return; + /* Check the user still exists */ if ((them) && (them == ServerInstance->SE->GetRef(theirfd))) { @@ -162,19 +165,26 @@ public: if(hostmask.length()) { - if(type == "webirc" && !password.length()) { + if (type == "webirc" && !password.length()) { ServerInstance->Log(DEFAULT, "m_cgiirc: Missing password in config: %s", hostmask.c_str()); - } else { - CGItype cgitype; - if(type == "pass") + } + else + { + CGItype cgitype = INVALID; + if (type == "pass") cgitype = PASS; - else if(type == "ident") + else if (type == "ident") cgitype = IDENT; - else if(type == "passfirst") + else if (type == "passfirst") cgitype = PASSFIRST; - else if(type == "webirc") { + else if (type == "webirc") + { cgitype = WEBIRC; } + + if (cgitype == INVALID) + cgitype = PASS; + Hosts.push_back(CGIhost(hostmask,cgitype, password.length() ? password : "" )); } }