mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Added user privilege level (#2228)
* Update log path example when running under windows Added example of log path syntax when running servatrice under windows. * Missed example bra cket * Added user privilege level Added a enum column in the users table named "privilevel" with the current values of "none", "vip", and "donator". Also allowed anyone with a higher privilege level than "none" to log in even if the server is set to limit the user total and the user limit is reached. This change add's the new user information into the users container that gets populated and passed between client and server. * Added user privilege level Added a enum column in the users table named "privilevel" with the current values of "none", "vip", and "donator". Also allowed anyone with a higher privilege level than "none" to log in even if the server is set to limit the user total and the user limit is reached. This change add's the new user information into the users container that gets populated and passed between client and server. * don't use corrected name when downloading card (#2164) * Fix dynamic user limit settings PR #2220 removed the ability to be able to change the max user limit count while the server is running requiring a restart to make the settings change. This PR reverts the behavior back to how it operated prior to the PR. * Call class functions for consistency Updated code to call functions for consistency. * don't use corrected name when downloading card (#2164) * Added user privilege level Added a enum column in the users table named "privilevel" with the current values of "none", "vip", and "donator". Also allowed anyone with a higher privilege level than "none" to log in even if the server is set to limit the user total and the user limit is reached. This change add's the new user information into the users container that gets populated and passed between client and server. * Corrected Typo Corrected typo in DB Migration Script * Git fuckup? * Added word column Added the word column to migration script for backwards compatibility
This commit is contained in:
parent
1197c10a70
commit
f17a0da434
6 changed files with 25 additions and 11 deletions
|
|
@ -533,6 +533,10 @@ ServerInfo_User Servatrice_DatabaseInterface::evalUserQueryResult(const QSqlQuer
|
|||
const QString clientid = query->value(9).toString();
|
||||
if (!clientid.isEmpty())
|
||||
result.set_clientid(clientid.toStdString());
|
||||
|
||||
const QString privlevel = query->value(10).toString();
|
||||
if (!privlevel.isEmpty())
|
||||
result.set_privlevel(privlevel.toStdString());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
@ -547,7 +551,7 @@ ServerInfo_User Servatrice_DatabaseInterface::getUserData(const QString &name, b
|
|||
if (!checkSql())
|
||||
return result;
|
||||
|
||||
QSqlQuery *query = prepareQuery("select id, name, admin, country, gender, realname, avatar_bmp, registrationDate, email, clientid from {prefix}_users where name = :name and active = 1");
|
||||
QSqlQuery *query = prepareQuery("select id, name, admin, country, gender, realname, avatar_bmp, registrationDate, email, clientid, privlevel from {prefix}_users where name = :name and active = 1");
|
||||
query->bindValue(":name", name);
|
||||
if (!execSqlQuery(query))
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue