From d7f4526a00dba2c6a97bc4c231f57c7aa179a691 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 12 Apr 2017 17:32:28 -0700 Subject: backend infrastructure for 'channel protection password'; which will be used to optionally encrypt export files and resolve channel/identity ownership/hijacking disputes --- include/channel.php | 6 +++++- include/import.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/channel.php b/include/channel.php index 1bdd5a478..0a4c9009a 100644 --- a/include/channel.php +++ b/include/channel.php @@ -537,6 +537,8 @@ function identity_basic_export($channel_id, $sections = null) { $ret['relocate'] = [ 'channel_address' => $r[0]['channel_address'], 'url' => z_root()]; if(in_array('channel',$sections)) { $ret['channel'] = $r[0]; + unset($ret['channel']['channel_password']); + unset($ret['channel']['channel_salt']); } } @@ -2020,7 +2022,9 @@ function channel_store_lowlevel($arr) { 'channel_deny_gid' => ((array_key_exists('channel_deny_gid',$arr)) ? $arr['channel_deny_gid'] : ''), 'channel_removed' => ((array_key_exists('channel_removed',$arr)) ? $arr['channel_removed'] : '0'), 'channel_system' => ((array_key_exists('channel_system',$arr)) ? $arr['channel_system'] : '0'), - 'channel_moved' => ((array_key_exists('channel_moved',$arr)) ? $arr['channel_moved'] : '') + 'channel_moved' => ((array_key_exists('channel_moved',$arr)) ? $arr['channel_moved'] : ''), + 'channel_password' => ((array_key_exists('channel_password',$arr)) ? $arr['channel_password'] : ''), + 'channel_salt' => ((array_key_exists('channel_salt',$arr)) ? $arr['channel_salt'] : '') ]; return create_table_from_array('channel',$store); diff --git a/include/import.php b/include/import.php index 9007dbe74..224bb1803 100644 --- a/include/import.php +++ b/include/import.php @@ -82,7 +82,7 @@ function import_channel($channel, $account_id, $seize) { 'channel_r_storage', 'channel_r_pages', 'channel_w_stream', 'channel_w_wall', 'channel_w_comment', 'channel_w_mail', 'channel_w_like', 'channel_w_tagwall', 'channel_w_chat', 'channel_w_storage', 'channel_w_pages', 'channel_a_republish', - 'channel_a_delegate', 'perm_limits' + 'channel_a_delegate', 'perm_limits', 'channel_password', 'channel_salt' ]; $clean = array(); -- cgit v1.2.3 From da07108be9a90c4729d2c7d888df7358dc795ed6 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 12 Apr 2017 17:43:27 -0700 Subject: make sure the new fields don't leak through sync packets and break older versions --- include/zot.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index 3e1b27c83..20a25ce3b 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2956,6 +2956,8 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) { return; $channel = $r[0]; + unset($channel['channel_password']); + unset($channel['channel_salt']); translate_channel_perms_outbound($channel); if($packet && array_key_exists('abook',$packet) && $packet['abook']) { -- cgit v1.2.3