UserSession class [2] - Refactor mod/ files

This commit is contained in:
Philipp 2022-10-20 21:02:49 +02:00
parent a729f3255d
commit bfe68702db
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
25 changed files with 201 additions and 201 deletions

View file

@ -42,7 +42,7 @@ use Friendica\Util\Temporal;
function cal_init(App $a)
{
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
}
@ -112,11 +112,11 @@ function cal_content(App $a)
$owner_uid = intval($owner['uid']);
$nick = $owner['nickname'];
$contact_id = Session::getRemoteContactID($owner['uid']);
$contact_id = DI::userSession()->getRemoteContactID($owner['uid']);
$remote_contact = $contact_id && DBA::exists('contact', ['id' => $contact_id, 'uid' => $owner['uid']]);
$is_owner = Session::getLocalUser() == $owner['uid'];
$is_owner = DI::userSession()->getLocalUserId() == $owner['uid'];
if ($owner['hidewall'] && !$is_owner && !$remote_contact) {
DI::sysmsg()->addNotice(DI::l10n()->t('Access to this profile has been restricted.'));
@ -278,7 +278,7 @@ function cal_content(App $a)
// If it the own calendar return to the events page
// otherwise to the profile calendar page
if (Session::getLocalUser() === $owner_uid) {
if (DI::userSession()->getLocalUserId() === $owner_uid) {
$return_path = "events";
} else {
$return_path = "cal/" . $nick;