aboutsummaryrefslogtreecommitdiffstats
path: root/mod/removeme.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/removeme.php')
-rw-r--r--mod/removeme.php23
1 files changed, 14 insertions, 9 deletions
diff --git a/mod/removeme.php b/mod/removeme.php
index ee88bd76a..f0b4ae3c0 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,10 +46,11 @@ 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:'),
- '$submit' => t('Remove My Account')
+ '$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 Channel')
));
return $o;