more perms work
This commit is contained in:
parent
7524948a97
commit
b5b57523f1
@ -8,6 +8,7 @@ namespace Zotlabs\Module;
|
|||||||
require_once('include/zot.php');
|
require_once('include/zot.php');
|
||||||
require_once('include/channel.php');
|
require_once('include/channel.php');
|
||||||
require_once('include/import.php');
|
require_once('include/import.php');
|
||||||
|
require_once('include/perm_upgrade.php');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -340,6 +341,8 @@ class Import extends \Zotlabs\Web\Controller {
|
|||||||
if($abooks) {
|
if($abooks) {
|
||||||
foreach($abooks as $abook) {
|
foreach($abooks as $abook) {
|
||||||
|
|
||||||
|
$abook_copy = $abook;
|
||||||
|
|
||||||
$abconfig = null;
|
$abconfig = null;
|
||||||
if(array_key_exists('abconfig',$abook) && is_array($abook['abconfig']) && count($abook['abconfig']))
|
if(array_key_exists('abconfig',$abook) && is_array($abook['abconfig']) && count($abook['abconfig']))
|
||||||
$abconfig = $abook['abconfig'];
|
$abconfig = $abook['abconfig'];
|
||||||
@ -347,6 +350,10 @@ class Import extends \Zotlabs\Web\Controller {
|
|||||||
unset($abook['abook_id']);
|
unset($abook['abook_id']);
|
||||||
unset($abook['abook_rating']);
|
unset($abook['abook_rating']);
|
||||||
unset($abook['abook_rating_text']);
|
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_account'] = $account_id;
|
||||||
$abook['abook_channel'] = $channel['channel_id'];
|
$abook['abook_channel'] = $channel['channel_id'];
|
||||||
if(! array_key_exists('abook_blocked',$abook)) {
|
if(! array_key_exists('abook_blocked',$abook)) {
|
||||||
@ -386,6 +393,8 @@ class Import extends \Zotlabs\Web\Controller {
|
|||||||
if(intval($abook['abook_feed']))
|
if(intval($abook['abook_feed']))
|
||||||
$feeds ++;
|
$feeds ++;
|
||||||
|
|
||||||
|
translate_abook_perms_inbound($channel,$abook_copy);
|
||||||
|
|
||||||
if($abconfig) {
|
if($abconfig) {
|
||||||
// @fixme does not handle sync of del_abconfig
|
// @fixme does not handle sync of del_abconfig
|
||||||
foreach($abconfig as $abc) {
|
foreach($abconfig as $abc) {
|
||||||
|
@ -521,6 +521,7 @@ function identity_basic_export($channel_id, $items = false) {
|
|||||||
$abconfig = load_abconfig($channel_id,$ret['abook'][$x]['abook_xchan']);
|
$abconfig = load_abconfig($channel_id,$ret['abook'][$x]['abook_xchan']);
|
||||||
if($abconfig)
|
if($abconfig)
|
||||||
$ret['abook'][$x]['abconfig'] = $abconfig;
|
$ret['abook'][$x]['abconfig'] = $abconfig;
|
||||||
|
translate_abook_perms_outbound($ret['abook'][$x]);
|
||||||
}
|
}
|
||||||
stringify_array_elms($xchans);
|
stringify_array_elms($xchans);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once('include/menu.php');
|
require_once('include/menu.php');
|
||||||
|
require_once('include/perm_upgrade.php');
|
||||||
|
|
||||||
function import_channel($channel, $account_id, $seize) {
|
function import_channel($channel, $account_id, $seize) {
|
||||||
|
|
||||||
|
@ -2938,6 +2938,12 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) {
|
|||||||
$channel = $r[0];
|
$channel = $r[0];
|
||||||
|
|
||||||
translate_channel_perms_outbound($channel);
|
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']))
|
if(intval($channel['channel_removed']))
|
||||||
return;
|
return;
|
||||||
@ -3195,6 +3201,8 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
|
|||||||
|
|
||||||
foreach($arr['abook'] as $abook) {
|
foreach($arr['abook'] as $abook) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$abconfig = null;
|
$abconfig = null;
|
||||||
|
|
||||||
if(array_key_exists('abconfig',$abook) && is_array($abook['abconfig']) && count($abook['abconfig']))
|
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) {
|
if($abconfig) {
|
||||||
// @fixme does not handle sync of del_abconfig
|
// @fixme does not handle sync of del_abconfig
|
||||||
foreach($abconfig as $abc) {
|
foreach($abconfig as $abc) {
|
||||||
|
Reference in New Issue
Block a user