From ab4863a2e0fb433784b16abed7df61dc49f749a1 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 28 Jan 2021 15:44:57 +0000 Subject: AS discovery for mod profile --- Zotlabs/Module/Profile.php | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) (limited to 'Zotlabs/Module/Profile.php') diff --git a/Zotlabs/Module/Profile.php b/Zotlabs/Module/Profile.php index 0373630a9..bce067b92 100644 --- a/Zotlabs/Module/Profile.php +++ b/Zotlabs/Module/Profile.php @@ -1,5 +1,12 @@ 'Profile', 'describes' => $p ], $channel); + } + + nav_set_selected('Profile'); + if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) { $which = $channel['channel_address']; $profile = argv(1); @@ -59,7 +74,7 @@ class Profile extends \Zotlabs\Web\Controller { dbesc(argv(1)) ); if($x) { - \App::$profile = $x[0]; + App::$profile = $x[0]; } } @@ -81,7 +96,7 @@ class Profile extends \Zotlabs\Web\Controller { $tab = 'profile'; $o = ''; - if(! (perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(), 'view_profile'))) { + if(! (perm_is_allowed(App::$profile['profile_uid'],get_observer_hash(), 'view_profile'))) { notice( t('Permission denied.') . EOL); return; } @@ -90,14 +105,14 @@ class Profile extends \Zotlabs\Web\Controller { if(argc() > 2 && argv(2) === 'vcard') { header('Content-type: text/vcard'); - header('content-disposition: attachment; filename="' . t('vcard') . '-' . \App::$profile['channel_address'] . '.vcf"' ); - echo \App::$profile['profile_vcard']; + header('content-disposition: attachment; filename="' . t('vcard') . '-' . App::$profile['channel_address'] . '.vcf"' ); + echo App::$profile['profile_vcard']; killme(); } - $is_owner = ((local_channel()) && (local_channel() == \App::$profile['profile_uid']) ? true : false); + $is_owner = ((local_channel()) && (local_channel() == App::$profile['profile_uid']) ? true : false); - if(\App::$profile['hidewall'] && (! $is_owner) && (! remote_channel())) { + if(App::$profile['hidewall'] && (! $is_owner) && (! remote_channel())) { notice( t('Permission denied.') . EOL); return; } @@ -105,7 +120,7 @@ class Profile extends \Zotlabs\Web\Controller { head_add_link([ 'rel' => 'alternate', 'type' => 'application/json+oembed', - 'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string), + 'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . App::$query_string), 'title' => 'oembed' ]); -- cgit v1.2.3