aboutsummaryrefslogtreecommitdiffstats
path: root/mod/removeme.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-11-12 18:27:36 -0800
committerfriendica <info@friendica.com>2013-11-12 18:27:36 -0800
commitb26989bb65615f7827047f87b3c4490f45b1f3e1 (patch)
tree88ca61f42dcafb730f43462bcb43ee514be802a6 /mod/removeme.php
parent061b438f97e40baf03cc449eac2aa4f1de33b60b (diff)
downloadvolse-hubzilla-b26989bb65615f7827047f87b3c4490f45b1f3e1.tar.gz
volse-hubzilla-b26989bb65615f7827047f87b3c4490f45b1f3e1.tar.bz2
volse-hubzilla-b26989bb65615f7827047f87b3c4490f45b1f3e1.zip
removeme sort of works for a single channel - lots of loose ends to deal with but it's a start
Diffstat (limited to 'mod/removeme.php')
-rw-r--r--mod/removeme.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/mod/removeme.php b/mod/removeme.php
index ee88bd76a..7af4719bd 100644
--- a/mod/removeme.php
+++ b/mod/removeme.php
@@ -17,13 +17,17 @@ function removeme_post(&$a) {
if($_POST['verify'] !== $_SESSION['remove_account_verify'])
return;
- $encrypted = hash('whirlpool',trim($_POST['qxz_password']));
- if((strlen($a->user['password'])) && ($encrypted === $a->user['password'])) {
- require_once('include/Contact.php');
- user_remove($a->user['uid']);
- // NOTREACHED
- }
+ $account = $a->get_account();
+
+ if(! account_verify_password($account['account_email'],$_POST['qxz_password']))
+ return;
+
+ require_once('include/Contact.php');
+
+ $global_remove = intval($_POST['global']);
+
+ channel_remove(local_user(),1 - $global_remove);
}
@@ -42,9 +46,10 @@ function removeme_content(&$a) {
$o .= replace_macros($tpl, array(
'$basedir' => $a->get_baseurl(),
'$hash' => $hash,
- '$title' => t('Remove My Account'),
- '$desc' => t('This will completely remove your account. Once this has been done it is not recoverable.'),
+ '$title' => t('Remove This Channel'),
+ '$desc' => t('This will completely remove this channel from the network. Once this has been done it is not recoverable.'),
'$passwd' => t('Please enter your password for verification:'),
+ '$global' => array('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')),
'$submit' => t('Remove My Account')
));