mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 03:53:26 -08:00
[Server] Serve account registration from the database interface (#7841)
cmdRegisterAccount and cmdActivateAccount still called Servatrice_DatabaseInterface for username validation, user existence, the per-email account limit, ban checks, registration and activation, and cmdRegisterAccount issued the activation-email insert inline. Add addActivationEmail to Server_DatabaseInterface with a false default, implement it with the same statement and bind value, and let both commands ask the injected interface. Validation order and every response code are unchanged.
This commit is contained in:
parent
7719ff021c
commit
d05198101d
4 changed files with 21 additions and 11 deletions
|
|
@ -359,6 +359,13 @@ bool Servatrice_DatabaseInterface::registerUser(const QString &userName,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Servatrice_DatabaseInterface::addActivationEmail(const QString &userName)
|
||||
{
|
||||
QSqlQuery *query = prepareQuery("insert into {prefix}_activation_emails (name) values(:name)");
|
||||
query->bindValue(":name", userName);
|
||||
return execSqlQuery(query);
|
||||
}
|
||||
|
||||
bool Servatrice_DatabaseInterface::activateUser(const QString &userName, const QString &token)
|
||||
{
|
||||
if (!checkSql()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue