From b5b57523f14597f13b88a93f8787bb5a4f966c58 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 18 Jul 2016 16:45:43 -0700 Subject: more perms work --- Zotlabs/Module/Import.php | 9 +++++++++ include/channel.php | 1 + include/import.php | 1 + include/zot.php | 14 ++++++++++++++ 4 files changed, 25 insertions(+) diff --git a/Zotlabs/Module/Import.php b/Zotlabs/Module/Import.php index e34f5e49e..d27f013b9 100644 --- a/Zotlabs/Module/Import.php +++ b/Zotlabs/Module/Import.php @@ -8,6 +8,7 @@ namespace Zotlabs\Module; require_once('include/zot.php'); require_once('include/channel.php'); require_once('include/import.php'); +require_once('include/perm_upgrade.php'); @@ -339,6 +340,8 @@ class Import extends \Zotlabs\Web\Controller { $abooks = $data['abook']; if($abooks) { foreach($abooks as $abook) { + + $abook_copy = $abook; $abconfig = null; if(array_key_exists('abconfig',$abook) && is_array($abook['abconfig']) && count($abook['abconfig'])) @@ -347,6 +350,10 @@ class Import extends \Zotlabs\Web\Controller { unset($abook['abook_id']); unset($abook['abook_rating']); unset($abook['abook_rating_text']); + unset($abook['abconfig']); + unset($abook['abook_their_perms']); + unset($abook['abook_my_perms']); + $abook['abook_account'] = $account_id; $abook['abook_channel'] = $channel['channel_id']; if(! array_key_exists('abook_blocked',$abook)) { @@ -385,6 +392,8 @@ class Import extends \Zotlabs\Web\Controller { $friends ++; if(intval($abook['abook_feed'])) $feeds ++; + + translate_abook_perms_inbound($channel,$abook_copy); if($abconfig) { // @fixme does not handle sync of del_abconfig 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 @@