From 9b08051703ff6695ba989f1cb968200ca59daeb1 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 26 Jan 2016 16:57:36 -0800 Subject: bring back the ability to ignore a pending connection request without deleting it and without always having it in your face and without jumping through hoops. --- mod/import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/import.php') diff --git a/mod/import.php b/mod/import.php index 02e71233a..b6091d944 100644 --- a/mod/import.php +++ b/mod/import.php @@ -123,7 +123,7 @@ function import_account(&$a, $account_id) { if(array_key_exists('channel',$data)) { if($completed < 1) { - $channel = import_channel($data['channel'], $account_id); + $channel = import_channel($data['channel'], $account_id, $seize); } else { -- cgit v1.2.3 From 021584d782c5bfafaa5ffe26d0c5850c8fffdd8f Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 5 Feb 2016 23:45:16 -0800 Subject: fix uno import by disabling for now --- mod/import.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mod/import.php') diff --git a/mod/import.php b/mod/import.php index b6091d944..1a2c87a63 100644 --- a/mod/import.php +++ b/mod/import.php @@ -109,6 +109,9 @@ function import_account(&$a, $account_id) { return; } + if(UNO) + return; + if(array_key_exists('compatibility',$data) && array_key_exists('database',$data['compatibility'])) { $v1 = substr($data['compatibility']['database'],-4); $v2 = substr(DB_UPDATE_VERSION,-4); @@ -116,6 +119,12 @@ function import_account(&$a, $account_id) { $t = sprintf( t('Warning: Database versions differ by %1$d updates.'), $v2 - $v1 ); notice($t); } + if(array_key_exists('server_role',$data['compatibility']) + && $data['compatibility']['server_role'] != UNO) { + notice( t('Server platform is not compatible. Operation not permitted.') . EOL); + return; + } + } // import channel -- cgit v1.2.3 From d8e6fd5df0713ef4f52277944d15fd8230deec81 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 7 Feb 2016 18:11:10 -0800 Subject: provide get_server_role() to abstract different roles and capabilities --- mod/import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/import.php') diff --git a/mod/import.php b/mod/import.php index 1a2c87a63..0bbd38ffe 100644 --- a/mod/import.php +++ b/mod/import.php @@ -120,7 +120,7 @@ function import_account(&$a, $account_id) { notice($t); } if(array_key_exists('server_role',$data['compatibility']) - && $data['compatibility']['server_role'] != UNO) { + && $data['compatibility']['server_role'] != get_server_role()) { notice( t('Server platform is not compatible. Operation not permitted.') . EOL); return; } -- cgit v1.2.3 From 342fda94e4162634eeb67c18c1d284e7d78f217f Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 18 Feb 2016 15:24:58 -0800 Subject: Provide Zotlabs\Project and System class for querying details about the project/version info. Move these out of /boot.php --- mod/import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/import.php') diff --git a/mod/import.php b/mod/import.php index 0bbd38ffe..184159585 100644 --- a/mod/import.php +++ b/mod/import.php @@ -120,7 +120,7 @@ function import_account(&$a, $account_id) { notice($t); } if(array_key_exists('server_role',$data['compatibility']) - && $data['compatibility']['server_role'] != get_server_role()) { + && $data['compatibility']['server_role'] != Zotlabs\Project\System::get_server_role()) { notice( t('Server platform is not compatible. Operation not permitted.') . EOL); return; } -- cgit v1.2.3 From be2b7c0b5f7f9b8080affbb4bc44c5adda18e82f Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 29 Feb 2016 19:31:52 -0800 Subject: abconfig --- mod/import.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mod/import.php') diff --git a/mod/import.php b/mod/import.php index 184159585..0b239d822 100644 --- a/mod/import.php +++ b/mod/import.php @@ -341,6 +341,10 @@ function import_account(&$a, $account_id) { if($abooks) { foreach($abooks as $abook) { + $abconfig = null; + if(array_key_exists('abconfig',$abook) && is_array($abook['abconfig']) && count($abook['abconfig'])) + $abconfig = $abook['abconfig']; + unset($abook['abook_id']); unset($abook['abook_rating']); unset($abook['abook_rating_text']); @@ -382,6 +386,17 @@ function import_account(&$a, $account_id) { $friends ++; if(intval($abook['abook_feed'])) $feeds ++; + + if($abconfig) { + // @fixme does not handle sync of del_abconfig + foreach($abconfig as $abc) { + if($abc['chan'] === $channel['channel_hash']) + set_abconfig($abc['chan'],$abc['xchan'],$abc['cat'],$abc['k'],$abc['v']); + } + } + + + } } logger('import step 8'); -- cgit v1.2.3 From 7732532964cfa43c371ee70418fea0279846c7b6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 9 Mar 2016 15:56:51 -0800 Subject: handle UNO move channel operation --- mod/import.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'mod/import.php') diff --git a/mod/import.php b/mod/import.php index 0b239d822..f91f261a5 100644 --- a/mod/import.php +++ b/mod/import.php @@ -108,10 +108,9 @@ function import_account(&$a, $account_id) { import_diaspora($data); return; } - - if(UNO) - return; - + + $moving = false; + if(array_key_exists('compatibility',$data) && array_key_exists('database',$data['compatibility'])) { $v1 = substr($data['compatibility']['database'],-4); $v2 = substr(DB_UPDATE_VERSION,-4); @@ -119,14 +118,13 @@ function import_account(&$a, $account_id) { $t = sprintf( t('Warning: Database versions differ by %1$d updates.'), $v2 - $v1 ); notice($t); } - if(array_key_exists('server_role',$data['compatibility']) - && $data['compatibility']['server_role'] != Zotlabs\Project\System::get_server_role()) { - notice( t('Server platform is not compatible. Operation not permitted.') . EOL); - return; - } - + if(array_key_exists('server_role',$data['compatibility']) && $data['compatibility']['server_role'] == 'basic') + $moving = true; } + if($moving) + $seize = 1; + // import channel if(array_key_exists('channel',$data)) { @@ -189,7 +187,7 @@ function import_account(&$a, $account_id) { if($completed < 4) { - if(is_array($data['hubloc'])) { + if(is_array($data['hubloc']) && (! $moving)) { import_hublocs($channel,$data['hubloc'],$seize); } -- cgit v1.2.3 From 1cd3b4182595b838a535dd6b6990251db05d49e6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 30 Mar 2016 22:13:24 -0700 Subject: deprecate $a->get_baseurl() --- mod/import.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mod/import.php') diff --git a/mod/import.php b/mod/import.php index f91f261a5..0e41d41f3 100644 --- a/mod/import.php +++ b/mod/import.php @@ -246,9 +246,9 @@ function import_account(&$a, $account_id) { dbesc($channel['channel_guid']), dbesc($channel['channel_guid_sig']), dbesc($channel['channel_pubkey']), - dbesc($a->get_baseurl() . "/photo/profile/l/" . $channel['channel_id']), - dbesc($a->get_baseurl() . "/photo/profile/m/" . $channel['channel_id']), - dbesc($a->get_baseurl() . "/photo/profile/s/" . $channel['channel_id']), + dbesc(z_root() . "/photo/profile/l/" . $channel['channel_id']), + dbesc(z_root() . "/photo/profile/m/" . $channel['channel_id']), + dbesc(z_root() . "/photo/profile/s/" . $channel['channel_id']), dbesc($channel['channel_address'] . '@' . get_app()->get_hostname()), dbesc(z_root() . '/channel/' . $channel['channel_address']), dbesc(z_root() . '/follow?f=&url=%s'), -- cgit v1.2.3 From 9abd95fad3784a10fc48bc40f9b8a75d7d74edda Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 31 Mar 2016 16:06:03 -0700 Subject: static App --- mod/import.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mod/import.php') diff --git a/mod/import.php b/mod/import.php index 0e41d41f3..e0c2ffa82 100644 --- a/mod/import.php +++ b/mod/import.php @@ -149,7 +149,7 @@ function import_account(&$a, $account_id) { } if(! $channel) - $channel = $a->get_channel(); + $channel = App::get_channel(); if(! $channel) { logger('mod_import: channel not found. ', print_r($channel,true)); @@ -205,12 +205,12 @@ function import_account(&$a, $account_id) { dbesc($channel['channel_guid']), dbesc($channel['channel_guid_sig']), dbesc($channel['channel_hash']), - dbesc($channel['channel_address'] . '@' . get_app()->get_hostname()), + dbesc($channel['channel_address'] . '@' . App::get_hostname()), dbesc('zot'), intval(($seize) ? 1 : 0), dbesc(z_root()), dbesc(base64url_encode(rsa_sign(z_root(),$channel['channel_prvkey']))), - dbesc(get_app()->get_hostname()), + dbesc(App::get_hostname()), dbesc(z_root() . '/post'), dbesc(get_config('system','pubkey')) ); @@ -249,7 +249,7 @@ function import_account(&$a, $account_id) { dbesc(z_root() . "/photo/profile/l/" . $channel['channel_id']), dbesc(z_root() . "/photo/profile/m/" . $channel['channel_id']), dbesc(z_root() . "/photo/profile/s/" . $channel['channel_id']), - dbesc($channel['channel_address'] . '@' . get_app()->get_hostname()), + dbesc($channel['channel_address'] . '@' . App::get_hostname()), dbesc(z_root() . '/channel/' . $channel['channel_address']), dbesc(z_root() . '/follow?f=&url=%s'), dbesc(z_root() . '/poco/' . $channel['channel_address']), -- cgit v1.2.3 From 1b83d88fe66b8d0185b748874e3f15b763778c99 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 11 Apr 2016 13:03:34 -0700 Subject: remove references to ref_session_write - can't use --- mod/import.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'mod/import.php') diff --git a/mod/import.php b/mod/import.php index e0c2ffa82..b14b97777 100644 --- a/mod/import.php +++ b/mod/import.php @@ -165,7 +165,6 @@ function import_account(&$a, $account_id) { logger('import step 2'); $_SESSION['import_step'] = 2; - ref_session_write(session_id(), serialize($_SESSION)); } @@ -181,7 +180,6 @@ function import_account(&$a, $account_id) { logger('import step 3'); $_SESSION['import_step'] = 3; - ref_session_write(session_id(), serialize($_SESSION)); } @@ -193,7 +191,6 @@ function import_account(&$a, $account_id) { } logger('import step 4'); $_SESSION['import_step'] = 4; - ref_session_write(session_id(), serialize($_SESSION)); } if($completed < 5) { @@ -225,7 +222,6 @@ function import_account(&$a, $account_id) { } logger('import step 5'); $_SESSION['import_step'] = 5; - ref_session_write(session_id(), serialize($_SESSION)); } @@ -262,7 +258,6 @@ function import_account(&$a, $account_id) { } logger('import step 6'); $_SESSION['import_step'] = 6; - ref_session_write(session_id(), serialize($_SESSION)); } if($completed < 7) { @@ -323,7 +318,7 @@ function import_account(&$a, $account_id) { } logger('import step 7'); $_SESSION['import_step'] = 7; - ref_session_write(session_id(), serialize($_SESSION)); + } @@ -399,7 +394,6 @@ function import_account(&$a, $account_id) { } logger('import step 8'); $_SESSION['import_step'] = 8; - ref_session_write(session_id(), serialize($_SESSION)); } @@ -449,7 +443,6 @@ function import_account(&$a, $account_id) { } logger('import step 9'); $_SESSION['import_step'] = 9; - ref_session_write(session_id(), serialize($_SESSION)); } if(is_array($data['obj'])) -- cgit v1.2.3