Implement setting "Max number of networks" for user.

Fix #226
This commit is contained in:
Alexey Sokolov
2012-09-20 01:24:47 +07:00
parent 50e6c1bfab
commit 9b2898f603
8 changed files with 33 additions and 31 deletions

View File

@@ -417,12 +417,10 @@ void CClient::UserCommand(CString& sLine) {
PutStatus("Total: " + CString(vChans.size()) + " - Joined: " + CString(uNumJoined) +
" - Detached: " + CString(uNumDetached) + " - Disabled: " + CString(uNumDisabled));
} else if (sCommand.Equals("ADDNETWORK")) {
#ifndef ENABLE_ADD_NETWORK
if (!m_pUser->IsAdmin()) {
PutStatus("Permission denied");
if (!m_pUser->IsAdmin() && !m_pUser->HasSpaceForNewNetwork()) {
PutStatus("Network number limit reached. Ask an admin to increase the limit for you, or delete few old ones using /znc DelNetwork <name>");
return;
}
#endif
CString sNetwork = sLine.Token(1);