Check type before transfer card participants ownership

Signed-off-by: Sergey Shliakhov <husband.sergey@gmail.com>

temp
This commit is contained in:
Sergey Shliakhov
2020-06-09 05:21:24 +02:00
committed by Julius Härtl
parent ce85b4378f
commit 36a9d2e95c
6 changed files with 31 additions and 7 deletions

View File

@@ -155,9 +155,10 @@ class AssignmentMapper extends QBMapper implements IPermissionMapper {
public function transferOwnership($ownerId, $newOwnerId) {
$params = [
'owner' => $ownerId,
'newOwner' => $newOwnerId
'newOwner' => $newOwnerId,
'type' => AssignedUsers::TYPE_USER
];
$sql = "UPDATE `{$this->tableName}` SET `participant` = :newOwner WHERE `participant` = :owner";
$sql = "UPDATE `{$this->tableName}` SET `participant` = :newOwner WHERE `participant` = :owner AND `type`= :type";
$stmt = $this->execute($sql, $params);
$stmt->closeCursor();
}