Update GroupPresenter.php

This commit is contained in:
n1rwana 2021-12-16 21:38:05 +03:00
parent 1b82077f59
commit e33a15b0ed

View file

@ -271,7 +271,7 @@ final class GroupPresenter extends OpenVKPresenter
}
}
function renderChangeOwner(int $id, int $newOwnerID): void
function renderChangeOwner(int $id, int $newOwnerId): void
{
$this->assertUserLoggedIn();
$this->willExecuteWriteAction();
@ -283,11 +283,11 @@ final class GroupPresenter extends OpenVKPresenter
$this->flashFail("err", tr("error"), tr("incorrect_password"));
$club = $this->clubs->get($id);
$newOwner = (new Users)->get($newOwnerID);
$newOwner = (new Users)->get($newOwnerId);
if($this->user->id !== $club->getOwner()->getId())
$this->flashFail("err", tr("error"), tr("forbidden"));
$club->setOwner($newOwnerID);
$club->setOwner($newOwnerId);
$club->addManager($this->user->id);
$club->save();