diff options
author | Cash Costello <cash.costello@gmail.com> | 2009-07-10 22:42:22 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2009-07-10 22:42:22 +0000 |
commit | 5126effdfb53a622523dcade777a391680aac58a (patch) | |
tree | 86829a92100d9b58e8b08118483c8c696276b802 /views/default/tidypics/image_menu.php | |
parent | 4bd3c70f0d5073e16ccb90f8b1c4d01a9da909d9 (diff) | |
download | elgg-5126effdfb53a622523dcade777a391680aac58a.tar.gz elgg-5126effdfb53a622523dcade777a391680aac58a.tar.bz2 |
better checks on who can tag for group albums
Diffstat (limited to 'views/default/tidypics/image_menu.php')
-rw-r--r-- | views/default/tidypics/image_menu.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/views/default/tidypics/image_menu.php b/views/default/tidypics/image_menu.php index b4597a99f..d6568360c 100644 --- a/views/default/tidypics/image_menu.php +++ b/views/default/tidypics/image_menu.php @@ -10,14 +10,25 @@ *
**************************************************************************/
- $file_guid = $vars['file_guid'];
+ $image_guid = $vars['file_guid'];
$viewer = $vars['viewer'];
$owner = $vars['owner'];
$anytags = $vars['anytags'];
+ $album = $vars['album'];
if (get_plugin_setting('tagging', 'tidypics') != "disabled") {
+
+ $can_tag = false;
+
+ $container = get_entity($album->container_guid);
+ if ($container instanceof ElggGroup) {
+ $can_tag = $viewer && $container->isMember($viewer);
+ } else {
+ $can_tag = $viewer && $viewer->guid == $owner->guid || user_is_friend($owner->guid, $viewer->guid);
+ }
+
// only owner and friends of owner can tag
- if ($viewer && $viewer->guid == $owner->guid || user_is_friend($owner->guid, $viewer->guid)) {
+ if ($can_tag) {
?>
<li id="start_tagging"><a id="tidypics_tag_control" href="javascript:void(0)" onclick="startTagging()"><?= elgg_echo('tidypics:tagthisphoto') ?></a></li>
<?php
@@ -33,7 +44,7 @@ if (get_plugin_setting('download_link', 'tidypics') != "disabled") {
?>
-<li id="download_image"><a href="<?php echo $vars['url']; ?>action/tidypics/download?file_guid=<?php echo $file_guid; ?>"><?php echo elgg_echo("image:download"); ?></a></li>
+<li id="download_image"><a href="<?php echo $vars['url']; ?>action/tidypics/download?file_guid=<?php echo $image_guid; ?>"><?php echo elgg_echo("image:download"); ?></a></li>
<?php
}
?>
\ No newline at end of file |