From 3b375a3d3f6d0d7fef885edcc75097564a1f7987 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 21 Jan 2014 23:09:33 -0800 Subject: fix location of string file in Translations.md, fix some permissions and owner vagueness (potential bugs) in profile_tabs() --- include/conversation.php | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index a9bf69a3e..708348ddd 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1431,7 +1431,8 @@ function network_tabs() { function profile_tabs($a, $is_owner=False, $nickname=Null){ //echo "
"; var_dump($a->user); killme();
-	
+
+		
 	$channel = $a->get_channel();
 
 	if (is_null($nickname))
@@ -1451,33 +1452,38 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
 			'title' => t('Status Messages and Posts'),
 			'id'    => 'status-tab',
 		),
-		array(
+	);
+
+	$p = get_all_perms($a->profile['profile_uid'],get_observer_hash());
+
+	if($p['view_profile']) {
+		$tabs[] = array(
 			'label' => t('About'),
 			'url' 	=> $pr,
 			'sel'	=> ((argv(0) == 'profile') ? 'active' : ''),
 			'title' => t('Profile Details'),
 			'id'    => 'profile-tab',
-		),
-		array(
+		);
+	}
+	if($p['view_photos']) {
+		$tabs[] = array(
 			'label' => t('Photos'),
 			'url'	=> $a->get_baseurl() . '/photos/' . $nickname,
 			'sel'	=> ((argv(0) == 'photos') ? 'active' : ''),
 			'title' => t('Photo Albums'),
 			'id'    => 'photo-tab',
-		),
-
-		array(
+		);
+	}
+	if($p['view_storage']) {
+		$tabs[] = array(
 			'label' => t('Files'),
 			'url'	=> $a->get_baseurl() . '/cloud/' . $nickname,
 			'sel'	=> ((argv(0) == 'cloud') ? 'active' : ''),
 			'title' => t('Files and Storage'),
 			'id'    => 'files-tab',
-		),
-
-	);
-
-
-	if ($is_owner){
+		);
+	}
+	if($is_owner) {
 		$tabs[] = array(
 			'label' => t('Events'),
 			'url'	=> $a->get_baseurl() . '/events',
@@ -1485,15 +1491,18 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
 			'title' => t('Events and Calendar'),
 			'id'    => 'events-tab',
 		);
-		if(feature_enabled(local_user(),'webpages')){
+	}
+
+	if($is_owner && feature_enabled($a->profile['profile_uid'],'webpages')) {
 		$tabs[] = array(
 			'label' => t('Webpages'),
 			'url'	=> $a->get_baseurl() . '/webpages/' . $nickname,
 			'sel' 	=> ((argv(0) == 'webpages') ? 'active' : ''),
 			'title' => t('Manage Webpages'),
 			'id'    => 'webpages-tab',
-		);}
+		);
 	}
+
 	else {
 		// FIXME
 		// we probably need a listing of events that were created by 
-- 
cgit v1.2.3