diff options
author | redmatrix <git@macgirvin.com> | 2016-07-18 16:45:43 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-07-18 16:45:43 -0700 |
commit | b5b57523f14597f13b88a93f8787bb5a4f966c58 (patch) | |
tree | 0463cf24db71539ba4bf355f60b7e9f461677109 /include | |
parent | 7524948a970271072030b3f67183152b2c23081b (diff) | |
download | volse-hubzilla-b5b57523f14597f13b88a93f8787bb5a4f966c58.tar.gz volse-hubzilla-b5b57523f14597f13b88a93f8787bb5a4f966c58.tar.bz2 volse-hubzilla-b5b57523f14597f13b88a93f8787bb5a4f966c58.zip |
more perms work
Diffstat (limited to 'include')
-rw-r--r-- | include/channel.php | 1 | ||||
-rw-r--r-- | include/import.php | 1 | ||||
-rw-r--r-- | include/zot.php | 14 |
3 files changed, 16 insertions, 0 deletions
diff --git a/include/channel.php b/include/channel.php index 12b4152ca..bec7d11d6 100644 --- a/include/channel.php +++ b/include/channel.php @@ -521,6 +521,7 @@ function identity_basic_export($channel_id, $items = false) { $abconfig = load_abconfig($channel_id,$ret['abook'][$x]['abook_xchan']); if($abconfig) $ret['abook'][$x]['abconfig'] = $abconfig; + translate_abook_perms_outbound($ret['abook'][$x]); } stringify_array_elms($xchans); } diff --git a/include/import.php b/include/import.php index 7a19ab68f..e4f5ba5a7 100644 --- a/include/import.php +++ b/include/import.php @@ -1,6 +1,7 @@ <?php require_once('include/menu.php'); +require_once('include/perm_upgrade.php'); function import_channel($channel, $account_id, $seize) { diff --git a/include/zot.php b/include/zot.php index 2ebcc4bf0..0a835a909 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2938,6 +2938,12 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) { $channel = $r[0]; translate_channel_perms_outbound($channel); + if($packet && array_key_exists('abook',$packet) && $packet['abook']) { + for($x = 0; $x < count($packet['abook']); $x ++) { + translate_abook_perms_outbound($packet['abook'][$x]); + } + } + if(intval($channel['channel_removed'])) return; @@ -3195,6 +3201,8 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { foreach($arr['abook'] as $abook) { + + $abconfig = null; if(array_key_exists('abconfig',$abook) && is_array($abook['abconfig']) && count($abook['abconfig'])) @@ -3289,6 +3297,12 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { } } + // This will set abconfig vars if the sender is using old-style fixed permissions + // using the raw abook record as passed to us. New-style permissions will fall through + // and be set using abconfig + + translate_abook_perms_inbound($channel,$abook); + if($abconfig) { // @fixme does not handle sync of del_abconfig foreach($abconfig as $abc) { |