<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
*/
class Delegation extends BaseSettings
{
- public static function post(array $parameters = [])
+ protected function post(array $request = [])
{
- if (!local_user() || empty(DI::app()->getUserId()) || DI::app()->getUserId() != local_user()) {
+ if (!DI::app()->isLoggedIn()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
}
DBA::update('user', ['parent-uid' => $parent_uid], ['uid' => local_user()]);
}
- public static function content(array $parameters = [])
+ protected function content(array $request = []): string
{
- parent::content($parameters);
+ parent::content();
if (!local_user()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));