mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-30 23:50:19 -07:00
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user