From d61f88b9799a1282102614f906858a3a78088625 Mon Sep 17 00:00:00 2001 From: Max Shinn Date: Mon, 27 Dec 2010 17:12:25 -0600 Subject: [PATCH] Only show photo uploads for logged in users --- plugins/GNUsocialPhotos/actions/photo.php | 2 +- plugins/GNUsocialPhotos/lib/photonav.php | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/GNUsocialPhotos/actions/photo.php b/plugins/GNUsocialPhotos/actions/photo.php index 4f194b1634..663d75a734 100644 --- a/plugins/GNUsocialPhotos/actions/photo.php +++ b/plugins/GNUsocialPhotos/actions/photo.php @@ -92,7 +92,7 @@ class PhotoAction extends Action $this->elementEnd('a'); $this->element('p', array(), $this->photo->photo_description); //This is a hack to hide the top-level comment - $this->element('style', array(), "#notice-{$this->photo->notice_id} div { display: none } #notice-{$this->photoid} ol li div { display: inline }"); + $this->element('style', array(), "#notice-{$this->photo->notice_id} div { display: none } #notice-{$this->photo->notice_id} ol li div { display: inline }"); $this->conversation->show(); } } diff --git a/plugins/GNUsocialPhotos/lib/photonav.php b/plugins/GNUsocialPhotos/lib/photonav.php index 217392907e..180f0ad20f 100644 --- a/plugins/GNUsocialPhotos/lib/photonav.php +++ b/plugins/GNUsocialPhotos/lib/photonav.php @@ -21,6 +21,7 @@ * * @package GNU Social * @author Ian Denhardt + * @author Max Shinn * @copyright 2010 Free Software Foundation, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 */ @@ -50,9 +51,12 @@ class GNUsocialPhotoNav extends Widget { $this->out->menuItem(common_local_url('photos', array('nickname' => $this->nickname)), _('Photos')); - - $this->out->menuItem(common_local_url('photoupload', array()), - _('Upload Photos')); + + $user = common_current_user(); + if (!empty($user)) { + $this->out->menuItem(common_local_url('photoupload', array()), + _('Upload Photos')); + } $this->out->elementEnd('ul'); } -- 2.39.2