use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Model\User;
+use Friendica\Network\HTTPException;
use Friendica\Network\Probe;
/**
{
static $owner;
- public static function init(array $parameters = [])
+ public function init()
{
- self::$owner = User::getOwnerDataByNick($parameters['profile']);
+ self::$owner = User::getOwnerDataByNick($this->parameters['profile']);
+ if (!self::$owner) {
+ throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
+ }
DI::page()['aside'] = Widget\VCard::getHTML(self::$owner);
}
- public static function post(array $parameters = [])
+ public function post()
{
if (!empty($_POST['cancel']) || empty($_POST['dfrn_url'])) {
DI::baseUrl()->redirect();
System::externalRedirect($follow_link);
}
- public static function content(array $parameters = [])
+ public function content(): string
{
if (empty(self::$owner)) {
return '';
'$submit' => DI::l10n()->t('Submit Request'),
'$cancel' => DI::l10n()->t('Cancel'),
- '$request' => 'remote_follow/' . $parameters['profile'],
+ '$request' => 'remote_follow/' . $this->parameters['profile'],
'$name' => self::$owner['name'],
'$myaddr' => Profile::getMyURL(),
]);