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

@@ -677,19 +677,7 @@ void CClient::AcceptLogin(CUser& User) {
PutStatusNotice("If you want to choose another network, use /znc JumpNetwork <network>, or connect to ZNC with username " + m_pUser->GetUserName() + "/<network> (instead of just " + m_pUser->GetUserName() + ")");
}
} else {
#ifndef ENABLE_ADD_NETWORK
if (!m_pUser->IsAdmin()) {
/* Since this user cannot add his own network,
* lets make them a default network */
m_pNetwork = m_pUser->AddNetwork("default");
} else {
#endif
PutStatusNotice("You have no networks configured. Use /znc AddNetwork <network> to add one.");
#ifndef ENABLE_ADD_NETWORK
}
#endif
}
SetNetwork(m_pNetwork, false);