X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FHCard.php;h=a6edd5100f5df1cd1b27c00a9d5116ef4956e9c6;hb=ffa44b8dc0b2ac0d65da245766cf0826e219d9a8;hp=e5547188bb4c7f56b62fa393c52e8a5c5fa6dc1b;hpb=fc283ab92858238a5a55f24b1d1650bb72068b7d;p=friendica.git
diff --git a/src/Module/HCard.php b/src/Module/HCard.php
index e5547188bb..a6edd5100f 100644
--- a/src/Module/HCard.php
+++ b/src/Module/HCard.php
@@ -1,6 +1,6 @@
getLocalUserId() && ($this->parameters['action'] ?? '') === 'view') {
// A logged in user views a profile of a user
- $nickname = $a->getNickname();
- } elseif (empty($parameters['action'])) {
+ $nickname = DI::app()->getLoggedInUserNickname();
+ } elseif (empty($this->parameters['action'])) {
// Show the profile hCard
- $nickname = $parameters['profile'];
+ $nickname = $this->parameters['profile'];
} else {
throw new HTTPException\NotFoundException(DI::l10n()->t('No profile'));
}
- $profile = Profile::load($a, $nickname, false);
+ $profile = User::getOwnerDataByNick($nickname);
if (empty($profile)) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
@@ -67,15 +64,6 @@ class HCard extends BaseModule
$page['htmlhead'] .= '' . "\r\n";
}
- // check if blocked
- if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
- $keywords = $profile['pub_keywords'] ?? '';
- $keywords = str_replace([',', ' ', ',,'], [' ', ',', ','], $keywords);
- if (strlen($keywords)) {
- $page['htmlhead'] .= '' . "\r\n";
- }
- }
-
$baseUrl = DI::baseUrl();
$uri = urlencode('acct:' . $profile['nickname'] . '@' . $baseUrl->getHostname() . ($baseUrl->getUrlPath() ? '/' . $baseUrl->getUrlPath() : ''));
@@ -88,5 +76,20 @@ class HCard extends BaseModule
foreach (['request', 'confirm', 'notify', 'poll'] as $dfrn) {
$page['htmlhead'] .= "get() . "/dfrn_{$dfrn}/{$nickname}\" />\r\n";
}
+
+ $block = (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated());
+
+ // check if blocked
+ if ($block) {
+ $keywords = $profile['pub_keywords'] ?? '';
+ $keywords = str_replace([',', ' ', ',,'], [' ', ',', ','], $keywords);
+ if (strlen($keywords)) {
+ $page['htmlhead'] .= '' . "\r\n";
+ }
+ }
+
+ $page['aside'] = Profile::getVCardHtml($profile, $block, false);
+
+ return '';
}
}