aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-05-27 02:37:12 -0700
committerFriendika <info@friendika.com>2011-05-27 02:37:12 -0700
commit763ff827d5f4d0f1728746ddad334fb851d47448 (patch)
tree2dcaa11cf0889d8d5e748534a483a72a245eb36e /mod
parentecb300177cf6996170a77880d771f0aa20f2cf11 (diff)
downloadvolse-hubzilla-763ff827d5f4d0f1728746ddad334fb851d47448.tar.gz
volse-hubzilla-763ff827d5f4d0f1728746ddad334fb851d47448.tar.bz2
volse-hubzilla-763ff827d5f4d0f1728746ddad334fb851d47448.zip
don't reset photo permissions unless photo has owner-only permissions
Diffstat (limited to 'mod')
-rw-r--r--mod/item.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/mod/item.php b/mod/item.php
index 82f33eaeb..b07f26e32 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -204,13 +204,25 @@ function item_post(&$a) {
continue;
$image_uri = substr($image,strrpos($image,'/') + 1);
$image_uri = substr($image_uri,0, strpos($image_uri,'-'));
+ $srch = '<' . intval($profile_uid) . '>';
+ $r = q("SELECT `id` FROM `photo` WHERE `allow_cid` = '%s' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = ''
+ AND `resource-id` = '%s' AND `uid` = %d LIMIT 1",
+ dbesc($srch),
+ dbesc($image_uri),
+ intval($profile_uid)
+ );
+ if(! count($r))
+ continue;
+
+
$r = q("UPDATE `photo` SET `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s'
- WHERE `resource-id` = '%s' AND `album` = '%s' ",
+ WHERE `resource-id` = '%s' AND `uid` = %d AND `album` = '%s' ",
dbesc($str_contact_allow),
dbesc($str_group_allow),
dbesc($str_contact_deny),
dbesc($str_group_deny),
dbesc($image_uri),
+ intval($profile_uid),
dbesc( t('Wall Photos'))
);