Add email registration restriction (#2350)

* Add ability to limit number of account registrations with same email address

This commit adds server side functionality that will allow operators to
limit the number of accounts that can be registered to the server with
the same email address.

* Updated ini wording

Updated configuration file wording for better description.
This commit is contained in:
woogerboy21 2017-01-07 11:26:23 -05:00 committed by GitHub
parent 3e39432ccc
commit a85b0dcbba
8 changed files with 37 additions and 2 deletions

View file

@ -906,6 +906,11 @@ Response::ResponseCode AbstractServerSocketInterface::cmdRegisterAccount(const C
if(sqlInterface->userExists(userName))
return Response::RespUserAlreadyExists;
if (servatrice->getMaxAccountsPerEmail() && !(sqlInterface->checkNumberOfUserAccounts(emailAddress) < servatrice->getMaxAccountsPerEmail()))
{
return Response::RespTooManyRequests;
}
QString banReason;
int banSecondsRemaining;
if (sqlInterface->checkUserIsBanned(this->getAddress(), userName, clientId, banReason, banSecondsRemaining))