diff --git a/Changelog b/Changelog index d481259f9..496a02d4b 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-01-31 DariusIII + * Chg: Add option to users to delete their account from profile page * Fix: Fix count of regexes for pager in Regexes class * Chg: Add option to fixtures up/down commands to specifiy which table fixtures to truncate or add * Chg: Update some faulty regexes diff --git a/public/index.php b/public/index.php index b1e208385..f501f5a5d 100644 --- a/public/index.php +++ b/public/index.php @@ -51,6 +51,7 @@ switch ($page->page) { case 'post_edit': case 'profile': case 'profileedit': + case 'profile_delete': case 'queue': case 'register': case 'sabqueuedata': diff --git a/public/pages/profile_delete.php b/public/pages/profile_delete.php new file mode 100644 index 000000000..b42b5793b --- /dev/null +++ b/public/pages/profile_delete.php @@ -0,0 +1,15 @@ +show403(); +} + +$userId = $_GET['id']; + +if ($userId !== null) { + User::logout(); + User::deleteUser($userId); + header('Location: '.WWW_TOP.'/'); +} diff --git a/public/themes/Charisma/profile.tpl b/public/themes/Charisma/profile.tpl index d65a20227..154b2b249 100755 --- a/public/themes/Charisma/profile.tpl +++ b/public/themes/Charisma/profile.tpl @@ -243,6 +243,7 @@ Edit Profile {/if} + Delete your account diff --git a/public/themes/Gamma/profile.tpl b/public/themes/Gamma/profile.tpl index e5f5b5477..737b12246 100755 --- a/public/themes/Gamma/profile.tpl +++ b/public/themes/Gamma/profile.tpl @@ -4,6 +4,7 @@ {if !$publicview}