From e2dfa1d72f36ecc85059a7f2a38084a4919eb704 Mon Sep 17 00:00:00 2001 From: Zot Date: Fri, 26 Apr 2019 09:34:58 +0200 Subject: import/export zot6 hublocs+xchans --- Zotlabs/Module/Import.php | 47 +++++++++++++++++++++++++++++++++++++++++------ include/channel.php | 7 +++++++ 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/Zotlabs/Module/Import.php b/Zotlabs/Module/Import.php index a48c690a7..18cb5560e 100644 --- a/Zotlabs/Module/Import.php +++ b/Zotlabs/Module/Import.php @@ -280,8 +280,9 @@ class Import extends \Zotlabs\Web\Controller { // replace any existing xchan we may have on this site if we're seizing control - $r = q("delete from xchan where xchan_hash = '%s'", - dbesc($channel['channel_hash']) + $r = q("delete from xchan where ( xchan_hash = '%s' or xchan_hash = '%s' ) ", + dbesc($channel['channel_hash']), + dbesc($channel['channel_portable_id']) ); $r = xchan_store_lowlevel( @@ -303,6 +304,30 @@ class Import extends \Zotlabs\Web\Controller { 'xchan_name_date' => datetime_convert() ] ); + + if($channel['channel_portable_id']) { + $r = xchan_store_lowlevel( + [ + 'xchan_hash' => \Zotlabs\Lib\Libzot::make_xchan_hash($channel['channel_guid'],$channel['channel_pubkey']), + 'xchan_guid' => $channel['channel_guid'], + 'xchan_guid_sig' => 'sha256.' . $channel['channel_guid_sig'], + 'xchan_pubkey' => $channel['channel_pubkey'], + 'xchan_photo_l' => z_root() . "/photo/profile/l/" . $channel['channel_id'], + 'xchan_photo_m' => z_root() . "/photo/profile/m/" . $channel['channel_id'], + 'xchan_photo_s' => z_root() . "/photo/profile/s/" . $channel['channel_id'], + 'xchan_addr' => channel_reddress($channel), + 'xchan_url' => z_root() . '/channel/' . $channel['channel_address'], + 'xchan_connurl' => z_root() . '/poco/' . $channel['channel_address'], + 'xchan_follow' => z_root() . '/follow?f=&url=%s', + 'xchan_name' => $channel['channel_name'], + 'xchan_network' => 'zot6', + 'xchan_photo_date' => datetime_convert(), + 'xchan_name_date' => datetime_convert() + ] + ); + } + + } logger('import step 6'); @@ -312,10 +337,20 @@ class Import extends \Zotlabs\Web\Controller { if($xchans) { foreach($xchans as $xchan) { - $hash = make_xchan_hash($xchan['xchan_guid'],$xchan['xchan_guid_sig']); - if($xchan['xchan_network'] === 'zot' && $hash !== $xchan['xchan_hash']) { - logger('forged xchan: ' . print_r($xchan,true)); - continue; + if($xchan['xchan_network'] === 'zot') { + $hash = make_xchan_hash($xchan['xchan_guid'],$xchan['xchan_guid_sig']); + if($hash !== $xchan['xchan_hash']) { + logger('forged xchan: ' . print_r($xchan,true)); + continue; + } + } + + if($xchan['xchan_network'] === 'zot6') { + $zhash = \Zotlabs\Lib\Libzot::make_xchan_hash($xchan['xchan_guid'],$xchan['xchan_pubkey']); + if($zhash !== $xchan['xchan_hash']) { + logger('forged xchan: ' . print_r($xchan,true)); + continue; + } } if(! array_key_exists('xchan_hidden',$xchan)) { diff --git a/include/channel.php b/include/channel.php index 47a7b5a0e..e4b6df47b 100644 --- a/include/channel.php +++ b/include/channel.php @@ -873,6 +873,13 @@ function identity_basic_export($channel_id, $sections = null) { $ret['abook'][$x]['abconfig'] = $abconfig; translate_abook_perms_outbound($ret['abook'][$x]); } + + // pick up the zot6 xchan and hublocs also + + if($ret['channel']['channel_portable_id']) { + $xchans[] = $ret['channel']['channel_portable_id']; + } + stringify_array_elms($xchans); } -- cgit v1.2.3 From a518471a270795425a2b835fae585d26303beebd Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 26 Apr 2019 11:28:06 +0200 Subject: update changelog --- CHANGELOG | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index b90ae34c9..23c1be7d5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,14 @@ +Hubzilla 4.0.3 (2019-04-26) + - Add attachments to zot6 event objects + - Add zot6 to federated transports + - Update import/export to handle zot6 hublocs and xchans + - Update fix_system_urls() to handle zot6 hublocs + - Fix infinite loop using postgres as backend + - Fix magic auth in combination with zot6 + - Fix check for required PHP version + - Diaspora: favour diaspora protocol identities over others with same hubloc or xchan address + + Hubzilla 4.0.2 (2019-04-08) - Port cdav calendar to fullcalendar version 4 - Fix perms_pending not evaluated correctly -- cgit v1.2.3 From eb44201c5f9cc80aca3c4704cc35b9d5fb766b71 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Sat, 27 Apr 2019 21:38:54 +0200 Subject: Use goaway() base function --- Zotlabs/Module/Photo.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index 30670c329..0dc6d0194 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -173,8 +173,7 @@ class Photo extends \Zotlabs\Web\Controller { // SSLify if needed if(strpos(z_root(),'https:') !== false && strpos($url,'https:') === false) $url = z_root() . '/sslify/' . $filename . '?f=&url=' . urlencode($url); - header("Location: " . $url); - killme(); + goaway($url); } } } -- cgit v1.2.3