diff options
author | Mario <mario@mariovavti.com> | 2021-03-09 10:47:13 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-03-09 12:10:27 +0100 |
commit | ed0410425085eb8de8dd67af843e1475c0036957 (patch) | |
tree | a5a925fba1f2b4ccb26bbbb0159932da0fb952a6 /Zotlabs | |
parent | 97e483d684960423f852ab4585731bdfd8f8cb3e (diff) | |
download | volse-hubzilla-ed0410425085eb8de8dd67af843e1475c0036957.tar.gz volse-hubzilla-ed0410425085eb8de8dd67af843e1475c0036957.tar.bz2 volse-hubzilla-ed0410425085eb8de8dd67af843e1475c0036957.zip |
fix profile not found if not logged in
(cherry picked from commit ed981ec8e818892ee15f0971e387cd269ec59689)
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Profile.php | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Zotlabs/Module/Profile.php b/Zotlabs/Module/Profile.php index 118f11f64..bcc7ad930 100644 --- a/Zotlabs/Module/Profile.php +++ b/Zotlabs/Module/Profile.php @@ -29,26 +29,28 @@ class Profile extends Controller { return; } - $profile = ''; - $channel = App::get_channel(); - - if (!$channel) - http_status_exit(404, 'Not found'); - if (ActivityStreams::is_as_request()) { + $channel = channelx_by_nick($which); + if (!$channel) { + http_status_exit(404, 'Not found'); + } + $p = Activity::encode_person($channel, true); as_return_and_die(['type' => 'Profile', 'describes' => $p], $channel); } - nav_set_selected('Profile'); + $profile = ''; if ((local_channel()) && (argc() > 2) && (argv(2) === 'view')) { + $channel = App::get_channel(); $which = $channel['channel_address']; $profile = argv(1); - $r = q("select profile_guid from profile where id = %d and uid = %d limit 1", + + $r = q("select profile_guid from profile where id = %d and uid = %d limit 1", intval($profile), intval(local_channel()) ); + if (!$r) $profile = ''; $profile = $r[0]['profile_guid']; @@ -80,7 +82,6 @@ class Profile extends Controller { profile_load($which, $profile); - } function get() { @@ -89,11 +90,10 @@ class Profile extends Controller { return login(); } - $groups = []; - + nav_set_selected('Profile'); - $tab = 'profile'; - $o = ''; + $groups = []; + $o = ''; if (!(perm_is_allowed(App::$profile['profile_uid'], get_observer_hash(), 'view_profile'))) { notice(t('Permission denied.') . EOL); |