]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
(sort of..) Revert commit 7736e920fe6ccaf9ad1984afc70db19efd4fb8cd - remove dupe...
[user/henk/code/inspircd.git] / src / users.cpp
index 39922104ea300a574243088f3d08507b8e5f526f..784783086ca21f8bc3df288dbca0d8478057fbe7 100644 (file)
@@ -399,7 +399,7 @@ const std::string& User::GetFullRealHost()
 
 bool User::IsInvited(const irc::string &channel)
 {
-       time_t now = ServerInstance->Time();
+       time_t now = time(NULL);
        InvitedList::iterator safei;
        for (InvitedList::iterator i = invites.begin(); i != invites.end(); ++i)
        {
@@ -421,7 +421,7 @@ bool User::IsInvited(const irc::string &channel)
 
 InvitedList* User::GetInviteList()
 {
-       time_t now = ServerInstance->Time();
+       time_t now = time(NULL);
        /* Weed out expired invites here. */
        InvitedList::iterator safei;
        for (InvitedList::iterator i = invites.begin(); i != invites.end(); ++i)
@@ -439,7 +439,7 @@ InvitedList* User::GetInviteList()
 
 void User::InviteTo(const irc::string &channel, time_t invtimeout)
 {
-       time_t now = ServerInstance->Time();
+       time_t now = time(NULL);
        if (invtimeout != 0 && now > invtimeout) return; /* Don't add invites that are expired from the get-go. */
        for (InvitedList::iterator i = invites.begin(); i != invites.end(); ++i)
        {
@@ -1830,6 +1830,9 @@ ConnectClass* User::SetClass(const std::string &explicit_name)
                {
                        ConnectClass* c = *i;
 
+                       if (c->GetDisabled())
+                               continue; // can't possibly match, removed from conf
+
                        if (explicit_name == c->GetName())
                        {
                                ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Explicitly set to %s", explicit_name.c_str());
@@ -1852,6 +1855,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 (!InspIRCd::MatchCIDR(this->GetIPString(), c->GetHost(), NULL) && 
                            !InspIRCd::MatchCIDR(this->host, c->GetHost(), NULL))