aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-03-09 10:47:13 +0000
committerMario <mario@mariovavti.com>2021-03-09 10:47:13 +0000
commited981ec8e818892ee15f0971e387cd269ec59689 (patch)
tree90b694865e2b401c10b5c3f7e45dff1c105cdcbf /Zotlabs
parent0932d2a0a62ff606b2934e75fd9be240bdc6dc2c (diff)
downloadvolse-hubzilla-ed981ec8e818892ee15f0971e387cd269ec59689.tar.gz
volse-hubzilla-ed981ec8e818892ee15f0971e387cd269ec59689.tar.bz2
volse-hubzilla-ed981ec8e818892ee15f0971e387cd269ec59689.zip
fix profile not found if not logged in
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Profile.php26
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);