X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FHCard.php;h=92627125abba940e358e29082426cbce555549eb;hb=8038c1b04ffa723ebd28610fb72927d8d21b3577;hp=c43e3975c3801039616cbd11b5090e8cea6b16a3;hpb=b8fa75b2dd70c3bdc7a4ba2f74d40fd290eaf0e8;p=friendica.git
diff --git a/src/Module/HCard.php b/src/Module/HCard.php
index c43e3975c3..92627125ab 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->getUserNickname();
- } 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,8 +64,23 @@ class HCard extends BaseModule
$page['htmlhead'] .= '' . "\r\n";
}
+ $baseUrl = DI::baseUrl();
+
+ $uri = urlencode('acct:' . $profile['nickname'] . '@' . $baseUrl->getHost() . ($baseUrl->getPath() ? '/' . $baseUrl->getPath() : ''));
+
+ $page['htmlhead'] .= '' . "\r\n";
+ $page['htmlhead'] .= '' . "\r\n";
+ $page['htmlhead'] .= '' . "\r\n";
+ header('Link: <' . $baseUrl . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
+
+ foreach (['request', 'confirm', 'notify', 'poll'] as $dfrn) {
+ $page['htmlhead'] .= "\r\n";
+ }
+
+ $block = (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated());
+
// check if blocked
- if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
+ if ($block) {
$keywords = $profile['pub_keywords'] ?? '';
$keywords = str_replace([',', ' ', ',,'], [' ', ',', ','], $keywords);
if (strlen($keywords)) {
@@ -76,17 +88,8 @@ class HCard extends BaseModule
}
}
- $baseUrl = DI::baseUrl();
-
- $uri = urlencode('acct:' . $profile['nickname'] . '@' . $baseUrl->getHostname() . ($baseUrl->getUrlPath() ? '/' . $baseUrl->getUrlPath() : ''));
+ $page['aside'] = Profile::getVCardHtml($profile, $block, false);
- $page['htmlhead'] .= '' . "\r\n";
- $page['htmlhead'] .= '' . "\r\n";
- $page['htmlhead'] .= '' . "\r\n";
- header('Link: <' . $baseUrl->get() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
-
- foreach (['request', 'confirm', 'notify', 'poll'] as $dfrn) {
- $page['htmlhead'] .= "get() . "/dfrn_{$dfrn}/{$nickname}\" />\r\n";
- }
+ return '';
}
}