mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
Fix permission check query
This commit is contained in:
parent
28e92d1a3c
commit
fc73ef304e
1 changed files with 3 additions and 4 deletions
|
|
@ -776,10 +776,9 @@ Response::ResponseCode AbstractServerSocketInterface::cmdReplayGetCode(const Com
|
||||||
|
|
||||||
// Check that user has access to replay match
|
// Check that user has access to replay match
|
||||||
{
|
{
|
||||||
QSqlQuery *query =
|
QSqlQuery *query = sqlInterface->prepareQuery(
|
||||||
sqlInterface->prepareQuery("select 1 from {prefix}_replays_access a left join {prefix}_replays b on "
|
"select 1 from {prefix}_replays_access where id_game = :id_game and id_player = :id_player");
|
||||||
"a.id_game = b.id_game where b.id = :id_replay and a.id_player = :id_player");
|
query->bindValue(":id_game", cmd.game_id());
|
||||||
query->bindValue(":id_replay", cmd.game_id());
|
|
||||||
query->bindValue(":id_player", userInfo->id());
|
query->bindValue(":id_player", userInfo->id());
|
||||||
if (!sqlInterface->execSqlQuery(query))
|
if (!sqlInterface->execSqlQuery(query))
|
||||||
return Response::RespInternalError;
|
return Response::RespInternalError;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue