From: brain Date: Tue, 1 May 2007 20:25:45 +0000 (+0000) Subject: Implement feature request in bug #271 by HiroP, allow disabling of maxlocal and maxgl... X-Git-Tag: v2.0.23~5547 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=2c04423995da525bd762dea2bbde9d3bb522f8c2;p=user%2Fhenk%2Fcode%2Finspircd.git Implement feature request in bug #271 by HiroP, allow disabling of maxlocal and maxglobal by leaving out each value from the tag git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6857 e03df62e-2008-0410-955e-edbf42e46eb7 --- diff --git a/include/users.h b/include/users.h index 80d9fb00c..0b5bc467f 100644 --- a/include/users.h +++ b/include/users.h @@ -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; } }; diff --git a/src/users.cpp b/src/users.cpp index ca2a27f0d..f75a2cf9f 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -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)");