diff --git a/include/Contact.php b/include/Contact.php index 98d3e7c0..7cac3c0e 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -6,6 +6,10 @@ // authorisation to do this. function user_remove($uid) { + if(! $uid) + return; + $a = get_app(); + logger('Removing user: ' . $uid); q("DELETE FROM `contact` WHERE `uid` = %d", intval($uid)); q("DELETE FROM `group` WHERE `uid` = %d", intval($uid)); q("DELETE FROM `group_member` WHERE `uid` = %d", intval($uid)); @@ -19,7 +23,7 @@ function user_remove($uid) { if($uid == local_user()) { unset($_SESSION['authenticated']); unset($_SESSION['uid']); - killme(); + goaway($a->get_baseurl()); } } diff --git a/mod/removeme.php b/mod/removeme.php new file mode 100644 index 00000000..62b9a6d1 --- /dev/null +++ b/mod/removeme.php @@ -0,0 +1,50 @@ +user['password'])) && ($encrypted === $a->user['password'])) { + require_once('include/Contact.php'); + user_remove($a->user['uid']); + // NOTREACHED + } + +} + + + +function removeme_content(&$a) { + + if(! local_user()) + goaway($a->get_baseurl()); + + $hash = random_string(); + + $_SESSION['remove_account_verify'] = $hash; + + $tpl = load_view_file('view/removeme.tpl'); + $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.'), + '$passwd' => t('Please enter your password for verification:'), + '$submit' => t('Remove My Account') + )); + + return $o; + +} \ No newline at end of file diff --git a/view/de/settings.tpl b/view/de/settings.tpl index 6259c171..0ef50546 100644 --- a/view/de/settings.tpl +++ b/view/de/settings.tpl @@ -5,7 +5,7 @@ $nickname_block -
+

Grundeinstellungen

diff --git a/view/en/settings.tpl b/view/en/settings.tpl index 5e1bfabf..97d67cbf 100644 --- a/view/en/settings.tpl +++ b/view/en/settings.tpl @@ -5,7 +5,7 @@ $nickname_block - +

Basic Settings

diff --git a/view/fr/settings.tpl b/view/fr/settings.tpl index 5e1bfabf..97d67cbf 100644 --- a/view/fr/settings.tpl +++ b/view/fr/settings.tpl @@ -5,7 +5,7 @@ $nickname_block - +

Basic Settings

diff --git a/view/it/settings.tpl b/view/it/settings.tpl index 2ff259ac..3b68923c 100644 --- a/view/it/settings.tpl +++ b/view/it/settings.tpl @@ -6,7 +6,7 @@ $nickname_block - +

Impostazioni base

diff --git a/view/removeme.tpl b/view/removeme.tpl new file mode 100644 index 00000000..a3ca8d4c --- /dev/null +++ b/view/removeme.tpl @@ -0,0 +1,20 @@ +

$title

+ +
+ +
$desc
+ + + + +
+ + +
+
+ + + + +
+