]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
This conflicted a few hours ago apparantly (????)
[user/henk/code/inspircd.git] / src / users.cpp
index 608d5f728b8e8ff16b6765bffada46ade4e49eda..db23d5672219799857e99d67e84cdc1d7d6fff4c 100644 (file)
@@ -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;
                }
        }