]> 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 afd26b1f868189194a577a6571430de1e5866789..db23d5672219799857e99d67e84cdc1d7d6fff4c 100644 (file)
@@ -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;
                }
        }