diff options
Diffstat (limited to 'mod/profile.php')
-rw-r--r-- | mod/profile.php | 68 |
1 files changed, 14 insertions, 54 deletions
diff --git a/mod/profile.php b/mod/profile.php index d59602ba0..fca7c8f9f 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -1,4 +1,12 @@ -<?php +<?php /** @file */ + +require_once('include/contact_widgets.php'); +require_once('include/items.php'); +require_once("include/bbcode.php"); +require_once('include/security.php'); +require_once('include/conversation.php'); +require_once('include/acl_selectors.php'); + function profile_init(&$a) { @@ -35,79 +43,32 @@ function profile_init(&$a) { $a->profile = $x[0]; } } -// $channel_display = get_pconfig($a->profile['profile_uid'],'system','channel_format'); -// if(! $channel_display) - profile_load($a,$which,$profile); - - -} + profile_load($a,$which,$profile); -function profile_aside(&$a) { - - require_once('include/contact_widgets.php'); - require_once('include/items.php'); - - profile_create_sidebar($a); } - function profile_content(&$a, $update = 0) { if(get_config('system','block_public') && (! get_account_id()) && (! remote_user())) { return login(); } - - require_once("include/bbcode.php"); - require_once('include/security.php'); - require_once('include/conversation.php'); - require_once('include/acl_selectors.php'); - require_once('include/items.php'); - $groups = array(); $tab = 'profile'; $o = ''; - - $contact = null; - $remote_contact = false; - - $contact_id = 0; - - if(is_array($_SESSION['remote'])) { - foreach($_SESSION['remote'] as $v) { - if($v['uid'] == $a->profile['profile_uid']) { - $contact_id = $v['cid']; - break; - } - } - } - - if($contact_id) { - $groups = init_groups_visitor($contact_id); - $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", - intval($contact_id), - intval($a->profile['profile_uid']) - ); - if(count($r)) { - $contact = $r[0]; - $remote_contact = true; - } + if(! (perm_is_allowed($a->profile['profile_uid'],get_observer_hash(), 'view_profile'))) { + notice( t('Access to this profile has been restricted.') . EOL); + return; } - if(! $remote_contact) { - if(local_user()) { - $contact_id = $_SESSION['cid']; - $contact = $a->contact; - } - } $is_owner = ((local_user()) && (local_user() == $a->profile['profile_uid']) ? true : false); - if($a->profile['hidewall'] && (! $is_owner) && (! $remote_contact)) { + if($a->profile['hidewall'] && (! $is_owner) && (! remote_user())) { notice( t('Access to this profile has been restricted.') . EOL); return; } @@ -116,7 +77,6 @@ function profile_content(&$a, $update = 0) { $o .= profile_tabs($a, $is_owner, $a->profile['channel_address']); - require_once('include/profile_advanced.php'); $o .= advanced_profile($a); call_hooks('profile_advanced',$o); return $o; |