]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Implement feature request in bug #271 by HiroP, allow disabling of maxlocal and maxgl...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Tue, 1 May 2007 20:25:45 +0000 (20:25 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Tue, 1 May 2007 20:25:45 +0000 (20:25 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6857 e03df62e-2008-0410-955e-edbf42e46eb7

include/users.h
src/users.cpp

index 80d9fb00cfdf046ccafba4f31deaa03c0770b92c..0b5bc467f2e69acf0026ffa3ad22191365e08cfb 100644 (file)
@@ -223,14 +223,14 @@ public:
         */
        unsigned long GetMaxLocal()
        {
-               return (maxlocal ? maxlocal : 1);
+               return maxlocal;
        }
 
        /** Returns the maximum number of global sessions
         */
        unsigned long GetMaxGlobal()
        {
-               return (maxglobal ? maxglobal : 1);
+               return maxglobal;
        }
 };
 
index ca2a27f0d2293dc074a0aab48c2f249aeb2202fb..f75a2cf9ffacfa887e1410ceb69238e0b581930c 100644 (file)
@@ -1004,14 +1004,14 @@ void userrec::FullConnect()
                return;
        }
 
-       if (this->LocalCloneCount() > a->GetMaxLocal())
+       if ((a->GetMaxLocal()) && (this->LocalCloneCount() > a->GetMaxLocal()))
        {
                this->muted = true;
                ServerInstance->GlobalCulls.AddItem(this, "No more connections allowed from your host via this connect class (local)");
                ServerInstance->WriteOpers("*** WARNING: maximum LOCAL connections (%ld) exceeded for IP %s", a->GetMaxLocal(), this->GetIPString());
                return;
        }
-       else if (this->GlobalCloneCount() > a->GetMaxGlobal())
+       else if ((a->GetMaxGlobal()) && (this->GlobalCloneCount() > a->GetMaxGlobal()))
        {
                this->muted = true;
                ServerInstance->GlobalCulls.AddItem(this, "No more connections allowed from your host via this connect class (global)");