X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusers.cpp;h=db23d5672219799857e99d67e84cdc1d7d6fff4c;hb=9d58c0986bfc4801a8d6388947f100317470bb5f;hp=afd26b1f868189194a577a6571430de1e5866789;hpb=d2a1d1df4323c95e926618d1839833cbc12f60ab;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/users.cpp b/src/users.cpp index afd26b1f8..db23d5672 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1719,8 +1719,24 @@ ConnectClass* User::SetClass(const std::string &explicit_name) { ConnectClass* c = *i; + if (c->GetType() == CC_ALLOW) + { + ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "ALLOW %s %d %s", c->GetHost().c_str(), c->GetPort(), c->GetName().c_str()); + } + else + { + ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "DENY %s %d %s", c->GetHost().c_str(), c->GetPort(), c->GetName().c_str()); + } + + /* if it's disabled, we can't match this one. */ + if (c->GetDisabled()) + { + ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Class disabled"); + continue; + } + /* check if host matches.. */ - if (((!match(this->GetIPString(),c->GetHost().c_str(),true)) && (!match(this->host,c->GetHost().c_str())))) + if (((!match(this->GetIPString(),c->GetHost(),true)) && (!match(this->host,c->GetHost())))) { ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "No host match (for %s)", c->GetHost().c_str()); continue; @@ -1736,28 +1752,22 @@ ConnectClass* User::SetClass(const std::string &explicit_name) continue; } - /* if it's disabled, we can't match this one. */ - if (c->GetDisabled()) - { - ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Class disabled"); - continue; - } - /* if it requires a port ... */ if (c->GetPort()) { - ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Requires port"); + ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Requires port (%d)", c->GetPort()); /* and our port doesn't match, fail. */ if (this->GetPort() != c->GetPort()) { - ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Port match failed"); + ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Port match failed (%d)", this->GetPort()); continue; } } - /* we match this class, BUT! we must keep checking in case a further class is type deny and also matches us. */ + /* we stop at the first class that meets ALL critera. */ found = c; + break; } }