blacklists = $blacklists; } function renderAddToBlacklist(): void { $this->willExecuteWriteAction(); $this->assertUserLoggedIn(); $record = new BlacklistItem; $target = (new Users)->get((int) $this->postParam("id")); $record->setAuthor($this->user->identity->getId()); $record->setTarget($this->postParam("id")); $record->setCreated(time()); $record->save(); $this->flashFail("succ", tr("success"), tr("user_blacklisted", $target->getCanonicalName())); } function renderRemoveFromBlacklist(): void { $this->willExecuteWriteAction(); $this->assertUserLoggedIn(); $record = $this->blacklists->getByAuthorAndTarget($this->user->identity->getId(), $this->postParam("id")); $name = $record->getTarget()->getCanonicalName(); $record->delete(false); $this->flashFail("succ", tr("success"), tr("user_removed_from_the_blacklist", $name)); } }