From 7df8dc8bcb0989a8543d699a7c667809170a69b3 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 25 Jul 2014 11:04:19 +0200 Subject: Add support for deleting user accounts Users can now delete their own accounts by clicking a link in the account edit form and confirming the deletion on a follow-up page. Signed-off-by: Lukas Fleischer --- web/html/account.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'web/html/account.php') diff --git a/web/html/account.php b/web/html/account.php index f212eab..d289950 100644 --- a/web/html/account.php +++ b/web/html/account.php @@ -55,6 +55,22 @@ if (isset($_COOKIE["AURSID"])) { } } + } elseif ($action == "DeleteAccount") { + /* Details for account being deleted. */ + $acctinfo = account_details(in_request('ID'), in_request('U')); + + if (can_edit_account($acctinfo)) { + $UID = $acctinfo['ID']; + if (in_request('confirm_Delete') && check_token()) { + user_delete($UID); + header('Location: /'); + } else { + $username = $acctinfo['Username']; + include("account_delete.php"); + } + } else { + print __("You do not have permission to edit this account."); + } } elseif ($action == "AccountInfo") { # no editing, just looking up user info # -- cgit v1.2.3-70-g09d2