aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorredmatrix <mike@macgirvin.com>2016-10-01 16:01:22 -0700
committerMario Vavti <mario@mariovavti.com>2016-10-02 10:05:42 +0200
commit1af56b102583ca9bd3373878aad64c5a5f7e2a65 (patch)
tree45eaa54222daee6d7418900fcca8053dab0c499a /include
parent27d5b9cfd00e9d7ed3d7d20b8f95ad92e8b97fc4 (diff)
downloadvolse-hubzilla-1af56b102583ca9bd3373878aad64c5a5f7e2a65.tar.gz
volse-hubzilla-1af56b102583ca9bd3373878aad64c5a5f7e2a65.tar.bz2
volse-hubzilla-1af56b102583ca9bd3373878aad64c5a5f7e2a65.zip
sync cloud storage permission changes (issue #538 continued)
Diffstat (limited to 'include')
-rw-r--r--include/attach.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/attach.php b/include/attach.php
index 3d55b3bcb..95ce09e3a 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -1198,7 +1198,11 @@ function attach_mkdirp($channel, $observer_hash, $arr = null) {
* @param string $deny_gid
* @param boolean $recurse (optional) default false
*/
-function attach_change_permissions($channel_id, $resource, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $recurse = false) {
+function attach_change_permissions($channel_id, $resource, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $recurse = false, $sync = false) {
+
+ $channel = channelx_by_n($channel_id);
+ if(! $channel)
+ return;
$r = q("select hash, flags, is_dir, is_photo from attach where hash = '%s' and uid = %d limit 1",
dbesc($resource),
@@ -1216,7 +1220,7 @@ function attach_change_permissions($channel_id, $resource, $allow_cid, $allow_gi
);
if($r) {
foreach($r as $rr) {
- attach_change_permissions($channel_id, $rr['hash'], $allow_cid, $allow_gid, $deny_cid, $deny_gid, $recurse);
+ attach_change_permissions($channel_id, $rr['hash'], $allow_cid, $allow_gid, $deny_cid, $deny_gid, $recurse, $sync);
}
}
}
@@ -1240,6 +1244,13 @@ function attach_change_permissions($channel_id, $resource, $allow_cid, $allow_gi
intval($channel_id)
);
}
+
+ if($sync) {
+ $data = attach_export_data($channel,$resource_id);
+
+ if($data)
+ build_sync_packet($channel['channel_id'],array('file' => array($data)));
+ }
}
/**