Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.1 KiB

10 years ago
10 years ago
  1. <?php
  2. function removeme_post(&$a) {
  3. if(! local_user())
  4. return;
  5. if((! x($_POST,'qxz_password')) || (! strlen(trim($_POST['qxz_password']))))
  6. return;
  7. if((! x($_POST,'verify')) || (! strlen(trim($_POST['verify']))))
  8. return;
  9. if($_POST['verify'] !== $_SESSION['remove_account_verify'])
  10. return;
  11. $encrypted = hash('whirlpool',trim($_POST['qxz_password']));
  12. if((strlen($a->user['password'])) && ($encrypted === $a->user['password'])) {
  13. require_once('include/Contact.php');
  14. user_remove($a->user['uid']);
  15. // NOTREACHED
  16. }
  17. }
  18. function removeme_content(&$a) {
  19. if(! local_user())
  20. goaway($a->get_baseurl());
  21. $hash = random_string();
  22. $_SESSION['remove_account_verify'] = $hash;
  23. $tpl = get_markup_template('removeme.tpl');
  24. $o .= replace_macros($tpl, array(
  25. '$basedir' => $a->get_baseurl(),
  26. '$hash' => $hash,
  27. '$title' => t('Remove My Account'),
  28. '$desc' => t('This will completely remove your account. Once this has been done it is not recoverable.'),
  29. '$passwd' => t('Please enter your password for verification:'),
  30. '$submit' => t('Remove My Account')
  31. ));
  32. return $o;
  33. }