diff options
author | Mario <mario@mariovavti.com> | 2020-03-02 09:50:11 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-03-02 09:50:11 +0000 |
commit | ba566fd64bbb57fb52779a3f29f30e730cab7744 (patch) | |
tree | 85ff6e77a4a0bbbdde7638055270f5a3a2b33f55 /include/channel.php | |
parent | 19bb9e018152ce528846fb955b58d76f1bb6bdec (diff) | |
parent | 85c07d57fe0f468eb8cc84584f3636b590aa929f (diff) | |
download | volse-hubzilla-ba566fd64bbb57fb52779a3f29f30e730cab7744.tar.gz volse-hubzilla-ba566fd64bbb57fb52779a3f29f30e730cab7744.tar.bz2 volse-hubzilla-ba566fd64bbb57fb52779a3f29f30e730cab7744.zip |
Merge branch 'dev' into z6connect
Diffstat (limited to 'include/channel.php')
-rw-r--r-- | include/channel.php | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/include/channel.php b/include/channel.php index 61603fb42..4aad64f3d 100644 --- a/include/channel.php +++ b/include/channel.php @@ -923,11 +923,38 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals $ret['abook'] = $r; for($x = 0; $x < count($ret['abook']); $x ++) { + $xchans[] = $ret['abook'][$x]['abook_xchan']; + $my_perms = []; + $their_perms = []; + $newconfig = []; $abconfig = load_abconfig($channel_id,$ret['abook'][$x]['abook_xchan']); - if($abconfig) - $ret['abook'][$x]['abconfig'] = $abconfig; + if($abconfig) { + foreach ($abconfig as $abc) { + + if ($abc['cat'] === 'my_perms' && intval($abc['v'])) { + $my_perms[] = $abc['k']; + continue; + } + if ($abc['cat'] === 'their_perms' && intval($abc['v'])) { + $their_perms[] = $abc['k']; + continue; + } + if ($zap_compat && preg_match('|^a:[0-9]+:{.*}$|s', $abc['v'])) { + $abc['v'] = serialise(unserialize($abc['v'])); + } + $newconfig[] = $abc; + } + + $ret['abook'][$x]['abconfig'] = $newconfig; + if ($zap_compat) { + $ret['abook'][$x]['abconfig'][] = [ 'chan' => $channel_id, 'xchan' => $ret['abook'][$x]['abook_chan'], 'cat' => 'system', 'k' => 'my_perms', 'v' => implode(',',$my_perms) ]; + $ret['abook'][$x]['abconfig'][] = [ 'chan' => $channel_id, 'xchan' => $ret['abook'][$x]['abook_chan'], 'cat' => 'system', 'k' => 'their_perms', 'v' => implode(',',$their_perms) ]; + } + } + translate_abook_perms_outbound($ret['abook'][$x]); + } // pick up the zot6 xchan and hublocs also @@ -967,8 +994,17 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals $r = q("select * from pconfig where uid = %d", intval($channel_id) ); - if($r) + + if($r) { + if ($zap_compat) { + for($x = 0; $x < count($r); $x ++) { + if (preg_match('|^a:[0-9]+:{.*}$|s', $r[$x]['v'])) { + $r[$x]['v'] = serialise(unserialize($r[$x]['v'])); + } + } + } $ret['config'] = $r; + } // All other term types will be included in items, if requested. |