From 5edec37d571b79dc4fcc30aac1c48b2fc1ae66c9 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 23 Sep 2020 12:14:16 +0000 Subject: 5.0RC testing: comment out global remove --- Zotlabs/Module/Removeaccount.php | 4 ++-- Zotlabs/Module/Removeme.php | 4 ++-- include/channel.php | 12 ++++++++++-- view/tpl/removeaccount.tpl | 2 ++ view/tpl/removeme.tpl | 2 ++ 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Zotlabs/Module/Removeaccount.php b/Zotlabs/Module/Removeaccount.php index 9d2bbd0de..cd18b79c0 100644 --- a/Zotlabs/Module/Removeaccount.php +++ b/Zotlabs/Module/Removeaccount.php @@ -37,7 +37,7 @@ class Removeaccount extends \Zotlabs\Web\Controller { } } - $global_remove = intval($_POST['global']); + $global_remove = 0; //intval($_POST['global']); account_remove($account_id, 1 - $global_remove); } @@ -57,7 +57,7 @@ class Removeaccount extends \Zotlabs\Web\Controller { '$title' => t('Remove This Account'), '$desc' => array(t('WARNING: '), t('This account and all its channels will be completely removed from the network. '), t('This action is permanent and can not be undone!')), '$passwd' => t('Please enter your password for verification:'), - '$global' => array('global', t('Remove this account, all its channels and all its channel clones from the network'), false, t('By default only the instances of the channels located on this hub will be removed from the network')), + // '$global' => array('global', t('Remove this account, all its channels and all its channel clones from the network'), false, t('By default only the instances of the channels located on this hub will be removed from the network')), '$submit' => t('Remove Account') )); diff --git a/Zotlabs/Module/Removeme.php b/Zotlabs/Module/Removeme.php index 451e280c3..876d61ca6 100644 --- a/Zotlabs/Module/Removeme.php +++ b/Zotlabs/Module/Removeme.php @@ -37,7 +37,7 @@ class Removeme extends \Zotlabs\Web\Controller { } } - $global_remove = intval($_POST['global']); + $global_remove = 0; //intval($_POST['global']); channel_remove(local_channel(),1 - $global_remove,true); @@ -60,7 +60,7 @@ class Removeme extends \Zotlabs\Web\Controller { '$title' => t('Remove This Channel'), '$desc' => [ t('WARNING: '), t('This channel will be completely removed from the network. '), t('This action is permanent and can not be undone!') ], '$passwd' => t('Please enter your password for verification:'), - '$global' => [ 'global', t('Remove this channel and all its clones from the network'), false, t('By default only the instance of the channel located on this hub will be removed from the network'), [ t('No'),t('Yes') ] ], + // '$global' => [ 'global', t('Remove this channel and all its clones from the network'), false, t('By default only the instance of the channel located on this hub will be removed from the network'), [ t('No'),t('Yes') ] ], '$submit' => t('Remove Channel') )); diff --git a/include/channel.php b/include/channel.php index 9424c8550..a51404652 100644 --- a/include/channel.php +++ b/include/channel.php @@ -2715,6 +2715,9 @@ function account_remove($account_id, $local = true, $unset_session = true) { logger('account_remove: ' . $account_id); + // Global removal (all clones) not currently supported + $local = true; + if(! intval($account_id)) { logger('No account.'); return false; @@ -2775,6 +2778,11 @@ function channel_remove($channel_id, $local = true, $unset_session = false) { if(! $channel_id) return; + // global removal (all clones) not currently supported + // hence this operation _may_ leave orphan data on remote servers + + $local = true; + logger('Removing channel: ' . $channel_id); logger('local only: ' . intval($local)); @@ -2793,6 +2801,7 @@ function channel_remove($channel_id, $local = true, $unset_session = false) { */ call_hooks('channel_remove', $r[0]); +/* if(! $local) { if(intval($r[0]['channel_removed'])) { @@ -2825,7 +2834,7 @@ function channel_remove($channel_id, $local = true, $unset_session = false) { Master::Summon(array('Notifier','purge_all',$channel_id)); } - +*/ $r = q("select iid from iconfig left join item on item.id = iconfig.iid where item.uid = %d", @@ -2929,7 +2938,6 @@ function channel_remove($channel_id, $local = true, $unset_session = false) { //remove from file system - $f = 'store/' . $channel['channel_address']; if(is_dir($f)) { @rrmdir($f); diff --git a/view/tpl/removeaccount.tpl b/view/tpl/removeaccount.tpl index ce6c8ac22..6cd554082 100644 --- a/view/tpl/removeaccount.tpl +++ b/view/tpl/removeaccount.tpl @@ -12,7 +12,9 @@ + {{if $global}} {{include file="field_checkbox.tpl" field=$global}} + {{/if}} diff --git a/view/tpl/removeme.tpl b/view/tpl/removeme.tpl index 40b9546d2..814701fff 100755 --- a/view/tpl/removeme.tpl +++ b/view/tpl/removeme.tpl @@ -12,7 +12,9 @@ + {{if $global}} {{include file="field_checkbox.tpl" field=$global}} + {{/if}} -- cgit v1.2.3