Merge pull request #1205 from ZeldaZach/fix_1173

Server Name Rules Information
This commit is contained in:
Zach 2015-07-04 19:37:50 -04:00
commit 31890450dc
7 changed files with 75 additions and 17 deletions

View file

@ -789,8 +789,14 @@ Response::ResponseCode ServerSocketInterface::cmdRegisterAccount(const Command_R
}
// TODO: Move this method outside of the db interface
if (!sqlInterface->usernameIsValid(userName))
QString errorString;
if (!sqlInterface->usernameIsValid(userName, errorString))
{
Response_Register *re = new Response_Register;
re->set_denied_reason_str(errorString.toStdString());
rc.setResponseExtension(re);
return Response::RespUsernameInvalid;
}
if(sqlInterface->userExists(userName))
return Response::RespUserAlreadyExists;