From f2fefb91d5f823385105fe693d0d82d7e236b511 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 18 Sep 2015 01:53:04 -0700 Subject: change photo permissions when attach permissions are changed through mod/filestorage, and fix lockview for photos. --- include/attach.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/attach.php b/include/attach.php index 513486bfc..39fdb5c3a 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1132,7 +1132,7 @@ function attach_mkdirp($channel, $observer_hash, $arr = null) { */ function attach_change_permissions($channel_id, $resource, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $recurse = false) { - $r = q("select hash, flags, is_dir from attach where hash = '%s' and uid = %d limit 1", + $r = q("select hash, flags, is_dir, is_photo from attach where hash = '%s' and uid = %d limit 1", dbesc($resource), intval($channel_id) ); @@ -1162,6 +1162,16 @@ function attach_change_permissions($channel_id, $resource, $allow_cid, $allow_gi dbesc($resource), intval($channel_id) ); + if($r[0]['is_photo']) { + $x = q("update photo set allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s' where resource_id = '%s' and uid = %d", + dbesc($allow_cid), + dbesc($allow_gid), + dbesc($deny_cid), + dbesc($deny_gid), + dbesc($resource), + intval($channel_id) + ); + } } /** -- cgit v1.2.3 From fdd4c1b9d19c2002ee105633e6b54245e5066534 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 18 Sep 2015 14:31:29 -0700 Subject: more work on surviving hub re-installs --- include/zot.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index ebdcb4cfb..69e361331 100644 --- a/include/zot.php +++ b/include/zot.php @@ -296,13 +296,17 @@ function zot_refresh($them, $channel = null, $force = false) { } else { $r = null; + // if they re-installed the server we could end up with the wrong record - pointing to the old install. + // We'll order by reverse id to try and pick off the newest one first and hopefully end up with the + // correct hubloc. If this doesn't work we may have to re-write this section to try them all. + if(array_key_exists('xchan_addr',$them) && $them['xchan_addr']) { - $r = q("select hubloc_url, hubloc_primary from hubloc where hubloc_addr = '%s'", + $r = q("select hubloc_url, hubloc_primary from hubloc where hubloc_addr = '%s' order by hubloc_id desc", dbesc($them['xchan_addr']) ); } if(! $r) { - $r = q("select hubloc_url, hubloc_primary from hubloc where hubloc_hash = '%s'", + $r = q("select hubloc_url, hubloc_primary from hubloc where hubloc_hash = '%s' order by hubloc_id desc", dbesc($them['xchan_hash']) ); } -- cgit v1.2.3 From 43251ed8ce8a59472686321b8faa2b352928d239 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 18 Sep 2015 22:00:33 -0700 Subject: add reporting site to delivery report --- include/gprobe.php | 3 +++ include/zot.php | 2 ++ 2 files changed, 5 insertions(+) (limited to 'include') diff --git a/include/gprobe.php b/include/gprobe.php index 48c1c8e14..d8d893d9e 100644 --- a/include/gprobe.php +++ b/include/gprobe.php @@ -14,6 +14,9 @@ function gprobe_run($argv, $argc){ $url = hex2bin($argv[1]); + if(! strpos($url,'@')) + return; + $r = q("select * from xchan where xchan_addr = '%s' limit 1", dbesc($url) ); diff --git a/include/zot.php b/include/zot.php index 69e361331..0b713faae 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1531,6 +1531,8 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ $result = array(); + $result['site'] = z_root(); + // We've validated the sender. Now make sure that the sender is the owner or author if(! $public) { -- cgit v1.2.3 From 9ed8eac8c624a5910710745a03a450291828a22d Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 18 Sep 2015 23:02:03 -0700 Subject: include site identitfier on redmatrix delivery reports also --- include/zot.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index d59329da4..4b3e23eea 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1547,6 +1547,8 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ $result = array(); + $result['site'] = z_root(); + // We've validated the sender. Now make sure that the sender is the owner or author if(! $public) { -- cgit v1.2.3