Permalink
Browse files

Merge pull request #429 from somasonic/master

Add the ability to set and retrieve MaxNetworks from controlpanel module
  • Loading branch information...
2 parents f6b8167 + 5f660f3 commit 74da8488efa1672acc7789a5470e566e02b7d5ce @DarthGandalf DarthGandalf committed Nov 17, 2013
Showing with 12 additions and 0 deletions.
  1. +12 −0 modules/controlpanel.cpp
View
@@ -68,6 +68,7 @@ class CAdminMod : public CModule {
{"Password", str},
{"JoinTries", integer},
{"MaxJoins", integer},
+ {"MaxNetworks", integer},
{"Timezone", str},
{"Admin", boolean},
{"AppendTimestamp", boolean},
@@ -188,6 +189,8 @@ class CAdminMod : public CModule {
PutModule("AutoClearChanBuffer = " + CString(pUser->AutoClearChanBuffer()));
else if (sVar == "maxjoins")
PutModule("MaxJoins = " + CString(pUser->MaxJoins()));
+ else if (sVar == "maxnetworks")
+ PutModule("MaxNetworks = " + CString(pUser->MaxNetworks()));
else if (sVar == "jointries")
PutModule("JoinTries = " + CString(pUser->JoinTries()));
else if (sVar == "timezone")
@@ -308,6 +311,15 @@ class CAdminMod : public CModule {
pUser->SetMaxJoins(i);
PutModule("MaxJoins = " + CString(pUser->MaxJoins()));
}
+ else if (sVar == "maxnetworks") {
+ if(m_pUser->IsAdmin()) {
+ unsigned int i = sValue.ToUInt();
+ pUser->SetMaxNetworks(i);
+ PutModule("MaxNetworks = " + sValue);
+ } else {
+ PutModule("Access denied!");
+ }
+ }
else if (sVar == "jointries") {
unsigned int i = sValue.ToUInt();
pUser->SetJoinTries(i);

0 comments on commit 74da848

Please sign in to comment.