X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofile.php;h=6f0ab9e077af456aa9b7eec2fa4af27923450536;hb=aff326f0d87322baefa361eb987f74d82e3cacde;hp=8df63705e407980871a3711e9df2e14c9a271fed;hpb=6df6d824271475f7699ad28a0b9f5fc0b7008c3c;p=friendica.git
diff --git a/mod/profile.php b/mod/profile.php
index 8df63705e4..6f0ab9e077 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -20,6 +20,7 @@ use Friendica\Model\Profile;
use Friendica\Module\Login;
use Friendica\Protocol\DFRN;
use Friendica\Util\DateTimeFormat;
+use Friendica\Util\Security;
use Friendica\Protocol\ActivityPub;
function profile_init(App $a)
@@ -33,7 +34,7 @@ function profile_init(App $a)
} else {
$r = q("SELECT `nickname` FROM `user` WHERE `blocked` = 0 AND `account_expired` = 0 AND `account_removed` = 0 AND `verified` = 1 ORDER BY RAND() LIMIT 1");
if (DBA::isResult($r)) {
- goaway(System::baseUrl() . '/profile/' . $r[0]['nickname']);
+ $a->internalRedirect('profile/' . $r[0]['nickname']);
} else {
logger('profile error: mod_profile ' . $a->query_string, LOGGER_DEBUG);
notice(L10n::t('Requested profile is not available.') . EOL);
@@ -53,8 +54,9 @@ function profile_init(App $a)
if (ActivityPub::isRequest()) {
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $which]);
if (DBA::isResult($user)) {
- $data = ActivityPub::profile($user['uid']);
+ $data = ActivityPub\Transmitter::getProfile($user['uid']);
echo json_encode($data);
+ header('Content-Type: application/activity+json');
exit();
}
}
@@ -90,7 +92,7 @@ function profile_init(App $a)
$a->page['htmlhead'] .= '' . "\r\n";
$a->page['htmlhead'] .= '' . "\r\n";
$a->page['htmlhead'] .= '' . "\r\n";
- $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->get_hostname() . ($a->urlpath ? '/' . $a->urlpath : ''));
+ $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->getHostName() . ($a->getURLPath() ? '/' . $a->getURLPath() : ''));
$a->page['htmlhead'] .= '' . "\r\n";
header('Link: <' . System::baseUrl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
@@ -129,7 +131,6 @@ function profile_content(App $a, $update = 0)
return Login::form();
}
- require_once 'include/security.php';
require_once 'include/conversation.php';
require_once 'include/items.php';
@@ -209,7 +210,7 @@ function profile_content(App $a, $update = 0)
$a->page['aside'] .= Widget::categories(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], (!empty($category) ? xmlify($category) : ''));
$a->page['aside'] .= Widget::tagCloud();
- if (can_write_wall($a->profile['profile_uid'])) {
+ if (Security::canWriteToUserWall($a->profile['profile_uid'])) {
$x = [
'is_owner' => $is_owner,
'allow_location' => ($is_owner || $commvisitor) && $a->profile['allow_location'],
@@ -233,7 +234,7 @@ function profile_content(App $a, $update = 0)
// Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched his/her groups
- $sql_extra = item_permissions_sql($a->profile['profile_uid'], $remote_contact, $groups);
+ $sql_extra = Item::getPermissionsSQLByUserId($a->profile['profile_uid'], $remote_contact, $groups);
$sql_extra2 = '';
if ($update) {
@@ -306,7 +307,7 @@ function profile_content(App $a, $update = 0)
$itemspage_network = $a->force_max_items;
}
- $a->set_pager_itemspage($itemspage_network);
+ $a->setPagerItemsPage($itemspage_network);
$pager_sql = sprintf(" LIMIT %d, %d ", intval($a->pager['start']), intval($a->pager['itemspage']));