X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusers.cpp;h=db23d5672219799857e99d67e84cdc1d7d6fff4c;hb=9d58c0986bfc4801a8d6388947f100317470bb5f;hp=608d5f728b8e8ff16b6765bffada46ade4e49eda;hpb=1fc43c1cab6a02df61955dc48dbf6bef3c586c4f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/users.cpp b/src/users.cpp index 608d5f728..db23d5672 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1728,6 +1728,13 @@ ConnectClass* User::SetClass(const std::string &explicit_name) 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(),true)) && (!match(this->host,c->GetHost())))) { @@ -1745,13 +1752,6 @@ 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()) { @@ -1765,8 +1765,9 @@ ConnectClass* User::SetClass(const std::string &explicit_name) } } - /* 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; } }